Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9710995

Browse files
committed
Make postgres prompt backend>, and remove PARSEDEBUG.
1 parent654f8f0 commit9710995

File tree

3 files changed

+7
-117
lines changed

3 files changed

+7
-117
lines changed

‎src/backend/parser/parse_clause.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.34 1999/05/17 18:22:18 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.35 1999/05/22 02:55:57 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -161,10 +161,6 @@ transformUsingClause(ParseState *pstate, List *onList, char *lname, char *rname)
161161
Attr*rattr=makeAttr(rname,i->name);
162162
A_Expr*e=makeNode(A_Expr);
163163

164-
#ifdefPARSEDEBUG
165-
printf("transformUsingClause- transform %s",nodeToString(i));
166-
#endif
167-
168164
e->oper=OP;
169165
e->opname="=";
170166
e->lexpr= (Node*)lattr;
@@ -199,16 +195,7 @@ printf("transformUsingClause- transform %s", nodeToString(i));
199195
{
200196
expr= (A_Expr*)qual;
201197
}
202-
203-
#ifdefPARSEDEBUG
204-
printf("transformUsingClause- transform %s",nodeToString(qual));
205-
#endif
206-
207198
}
208-
209-
#ifdefPARSEDEBUG
210-
printf(" to %s\n",nodeToString(expr));
211-
#endif
212199
}
213200
return ((Node*)transformExpr(pstate, (Node*)expr,EXPR_COLUMN_FIRST));
214201
}

‎src/backend/parser/parse_coerce.c

Lines changed: 3 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.13 1999/05/19 16:46:12 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.14 1999/05/22 02:55:57 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -41,18 +41,8 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
4141
Oidinfunc;
4242
Datumval;
4343

44-
#ifdefPARSEDEBUG
45-
printf("coerce_type: argument types are %d -> %u\n",
46-
inputTypeId,targetTypeId);
47-
#endif
48-
4944
if (targetTypeId==InvalidOid)
50-
{
51-
#ifdefPARSEDEBUG
52-
printf("coerce_type: apparent NULL target argument; suppress type conversion\n");
53-
#endif
5445
result=node;
55-
}
5646
elseif (inputTypeId!=targetTypeId)
5747
{
5848

@@ -61,13 +51,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
6151
* through...
6252
*/
6353
if (IS_BINARY_COMPATIBLE(inputTypeId,targetTypeId))
64-
{
65-
#ifdefPARSEDEBUG
66-
printf("coerce_type: argument type %s is known to be convertible to type %s\n",
67-
typeidTypeName(inputTypeId),typeidTypeName(targetTypeId));
68-
#endif
6954
result=node;
70-
}
7155

7256
/*
7357
* if not unknown input type, try for explicit conversion using
@@ -84,18 +68,10 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
8468
n->funcname=typeidTypeName(targetTypeId);
8569
n->args=lcons(node,NIL);
8670

87-
#ifdefPARSEDEBUG
88-
printf("coerce_type: construct function %s(%s)\n",
89-
typeidTypeName(targetTypeId),typeidTypeName(inputTypeId));
90-
#endif
91-
9271
result=transformExpr(pstate, (Node*)n,EXPR_COLUMN_FIRST);
9372
}
9473
else
9574
{
96-
#ifdefPARSEDEBUG
97-
printf("coerce_type: node is UNKNOWN type\n");
98-
#endif
9975
if (nodeTag(node)==T_Const)
10076
{
10177
Const*con= (Const*)node;
@@ -117,22 +93,11 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
11793
result= (Node*)con;
11894
}
11995
else
120-
{
121-
#ifdefPARSEDEBUG
122-
printf("coerce_type: should never get here!\n");
123-
#endif
12496
result=node;
125-
}
12697
}
12798
}
12899
else
129-
{
130-
#ifdefPARSEDEBUG
131-
printf("coerce_type: argument type IDs %u match\n",inputTypeId);
132-
#endif
133-
134100
result=node;
135-
}
136101

137102
returnresult;
138103
}/* coerce_type() */
@@ -163,10 +128,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
163128
/* run through argument list... */
164129
for (i=0;i<nargs;i++)
165130
{
166-
#ifdefPARSEDEBUG
167-
printf("can_coerce_type: argument #%d types are %u -> %u\n",
168-
i,input_typeids[i],func_typeids[i]);
169-
#endif
170131
if (input_typeids[i]!=func_typeids[i])
171132
{
172133

@@ -175,31 +136,14 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
175136
* through...
176137
*/
177138
if (IS_BINARY_COMPATIBLE(input_typeids[i],func_typeids[i]))
178-
{
179-
#ifdefPARSEDEBUG
180-
printf("can_coerce_type: argument #%d type %s is known to be convertible to type %s\n",
181-
i,typeidTypeName(input_typeids[i]),typeidTypeName(func_typeids[i]));
182-
#endif
183-
}
139+
;
184140

185141
/* don't know what to do for the output type? then quit... */
186142
elseif (func_typeids[i]==InvalidOid)
187-
{
188-
#ifdefPARSEDEBUG
189-
printf("can_coerce_type: output OID func_typeids[%u] is zero\n",i);
190-
#endif
191143
return false;
192-
}
193-
194144
/* don't know what to do for the input type? then quit... */
195145
elseif (input_typeids[i]==InvalidOid)
196-
{
197-
#ifdefPARSEDEBUG
198-
printf("can_coerce_type: input OID input_typeids[%u] is zero\n",i);
199-
#endif
200146
return false;
201-
}
202-
203147
/*
204148
* if not unknown input type, try for explicit conversion
205149
* using functions...
@@ -223,51 +167,13 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
223167
* should also check the function return type just to be
224168
* safe...
225169
*/
226-
if (HeapTupleIsValid(ftup))
227-
{
228-
#ifdefPARSEDEBUG
229-
printf("can_coerce_type: found function %s(%s) to convert argument #%d\n",
230-
typeidTypeName(func_typeids[i]),typeidTypeName(input_typeids[i]),i);
231-
#endif
232-
}
233-
else
234-
{
235-
#ifdefPARSEDEBUG
236-
printf("can_coerce_type: did not find function %s(%s) to convert argument #%d\n",
237-
typeidTypeName(func_typeids[i]),typeidTypeName(input_typeids[i]),i);
238-
#endif
170+
if (!HeapTupleIsValid(ftup))
239171
return false;
240-
}
241-
}
242-
else
243-
{
244-
#ifdefPARSEDEBUG
245-
printf("can_coerce_type: argument #%d type is %u (UNKNOWN)\n",
246-
i,input_typeids[i]);
247-
#endif
248172
}
249173

250174
tp=typeidType(input_typeids[i]);
251175
if (typeTypeFlag(tp)=='c')
252-
{
253-
#ifdefPARSEDEBUG
254-
printf("can_coerce_type: typeTypeFlag for %s is 'c'\n",
255-
typeidTypeName(input_typeids[i]));
256-
#endif
257176
return false;
258-
}
259-
260-
#ifdefPARSEDEBUG
261-
printf("can_coerce_type: conversion from %s to %s is possible\n",
262-
typeidTypeName(input_typeids[i]),typeidTypeName(func_typeids[i]));
263-
#endif
264-
}
265-
else
266-
{
267-
#ifdefPARSEDEBUG
268-
printf("can_coerce_type: argument #%d type IDs %u match\n",
269-
i,input_typeids[i]);
270-
#endif
271177
}
272178
}
273179

@@ -396,9 +302,6 @@ PreferredType(CATEGORY category, Oid type)
396302
result=UNKNOWNOID;
397303
break;
398304
}
399-
#ifdefPARSEDEBUG
400-
printf("PreferredType- (%d) preferred type is %s\n",category,typeidTypeName(result));
401-
#endif
402305
returnresult;
403306
}/* PreferredType() */
404307

‎src/backend/tcop/postgres.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.113 1999/05/13 07:28:46 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.114 1999/05/22 02:55:58 momjian Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -215,7 +215,7 @@ InteractiveBackend(char *inBuf)
215215
*display a prompt and obtain input from the user
216216
* ----------------
217217
*/
218-
printf("> ");
218+
printf("backend> ");
219219
fflush(stdout);
220220

221221
for (;;)
@@ -1485,7 +1485,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
14851485
if (!IsUnderPostmaster)
14861486
{
14871487
puts("\nPOSTGRES backend interactive interface ");
1488-
puts("$Revision: 1.113 $ $Date: 1999/05/13 07:28:46 $\n");
1488+
puts("$Revision: 1.114 $ $Date: 1999/05/22 02:55:58 $\n");
14891489
}
14901490

14911491
/* ----------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp