Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9710995f
Commit
9710995f
authored
May 22, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make postgres prompt backend>, and remove PARSEDEBUG.
parent
654f8f0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
117 deletions
+7
-117
src/backend/parser/parse_clause.c
src/backend/parser/parse_clause.c
+1
-14
src/backend/parser/parse_coerce.c
src/backend/parser/parse_coerce.c
+3
-100
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+3
-3
No files found.
src/backend/parser/parse_clause.c
View file @
9710995f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3
4 1999/05/17 18:22:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3
5 1999/05/22 02:55:57
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -161,10 +161,6 @@ transformUsingClause(ParseState *pstate, List *onList, char *lname, char *rname)
...
@@ -161,10 +161,6 @@ transformUsingClause(ParseState *pstate, List *onList, char *lname, char *rname)
Attr
*
rattr
=
makeAttr
(
rname
,
i
->
name
);
Attr
*
rattr
=
makeAttr
(
rname
,
i
->
name
);
A_Expr
*
e
=
makeNode
(
A_Expr
);
A_Expr
*
e
=
makeNode
(
A_Expr
);
#ifdef PARSEDEBUG
printf
(
"transformUsingClause- transform %s"
,
nodeToString
(
i
));
#endif
e
->
oper
=
OP
;
e
->
oper
=
OP
;
e
->
opname
=
"="
;
e
->
opname
=
"="
;
e
->
lexpr
=
(
Node
*
)
lattr
;
e
->
lexpr
=
(
Node
*
)
lattr
;
...
@@ -199,16 +195,7 @@ printf("transformUsingClause- transform %s", nodeToString(i));
...
@@ -199,16 +195,7 @@ printf("transformUsingClause- transform %s", nodeToString(i));
{
{
expr
=
(
A_Expr
*
)
qual
;
expr
=
(
A_Expr
*
)
qual
;
}
}
#ifdef PARSEDEBUG
printf
(
"transformUsingClause- transform %s"
,
nodeToString
(
qual
));
#endif
}
}
#ifdef PARSEDEBUG
printf
(
" to %s
\n
"
,
nodeToString
(
expr
));
#endif
}
}
return
((
Node
*
)
transformExpr
(
pstate
,
(
Node
*
)
expr
,
EXPR_COLUMN_FIRST
));
return
((
Node
*
)
transformExpr
(
pstate
,
(
Node
*
)
expr
,
EXPR_COLUMN_FIRST
));
}
}
...
...
src/backend/parser/parse_coerce.c
View file @
9710995f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.1
3 1999/05/19 16:46:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.1
4 1999/05/22 02:55:57
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -41,18 +41,8 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
...
@@ -41,18 +41,8 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
Oid
infunc
;
Oid
infunc
;
Datum
val
;
Datum
val
;
#ifdef PARSEDEBUG
printf
(
"coerce_type: argument types are %d -> %u
\n
"
,
inputTypeId
,
targetTypeId
);
#endif
if
(
targetTypeId
==
InvalidOid
)
if
(
targetTypeId
==
InvalidOid
)
{
#ifdef PARSEDEBUG
printf
(
"coerce_type: apparent NULL target argument; suppress type conversion
\n
"
);
#endif
result
=
node
;
result
=
node
;
}
else
if
(
inputTypeId
!=
targetTypeId
)
else
if
(
inputTypeId
!=
targetTypeId
)
{
{
...
@@ -61,13 +51,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
...
@@ -61,13 +51,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
* through...
* through...
*/
*/
if
(
IS_BINARY_COMPATIBLE
(
inputTypeId
,
targetTypeId
))
if
(
IS_BINARY_COMPATIBLE
(
inputTypeId
,
targetTypeId
))
{
#ifdef PARSEDEBUG
printf
(
"coerce_type: argument type %s is known to be convertible to type %s
\n
"
,
typeidTypeName
(
inputTypeId
),
typeidTypeName
(
targetTypeId
));
#endif
result
=
node
;
result
=
node
;
}
/*
/*
* if not unknown input type, try for explicit conversion using
* if not unknown input type, try for explicit conversion using
...
@@ -84,18 +68,10 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
...
@@ -84,18 +68,10 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
n
->
funcname
=
typeidTypeName
(
targetTypeId
);
n
->
funcname
=
typeidTypeName
(
targetTypeId
);
n
->
args
=
lcons
(
node
,
NIL
);
n
->
args
=
lcons
(
node
,
NIL
);
#ifdef PARSEDEBUG
printf
(
"coerce_type: construct function %s(%s)
\n
"
,
typeidTypeName
(
targetTypeId
),
typeidTypeName
(
inputTypeId
));
#endif
result
=
transformExpr
(
pstate
,
(
Node
*
)
n
,
EXPR_COLUMN_FIRST
);
result
=
transformExpr
(
pstate
,
(
Node
*
)
n
,
EXPR_COLUMN_FIRST
);
}
}
else
else
{
{
#ifdef PARSEDEBUG
printf
(
"coerce_type: node is UNKNOWN type
\n
"
);
#endif
if
(
nodeTag
(
node
)
==
T_Const
)
if
(
nodeTag
(
node
)
==
T_Const
)
{
{
Const
*
con
=
(
Const
*
)
node
;
Const
*
con
=
(
Const
*
)
node
;
...
@@ -117,22 +93,11 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
...
@@ -117,22 +93,11 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
result
=
(
Node
*
)
con
;
result
=
(
Node
*
)
con
;
}
}
else
else
{
#ifdef PARSEDEBUG
printf
(
"coerce_type: should never get here!
\n
"
);
#endif
result
=
node
;
result
=
node
;
}
}
}
}
}
else
else
{
#ifdef PARSEDEBUG
printf
(
"coerce_type: argument type IDs %u match
\n
"
,
inputTypeId
);
#endif
result
=
node
;
result
=
node
;
}
return
result
;
return
result
;
}
/* coerce_type() */
}
/* coerce_type() */
...
@@ -163,10 +128,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
...
@@ -163,10 +128,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
/* run through argument list... */
/* run through argument list... */
for
(
i
=
0
;
i
<
nargs
;
i
++
)
for
(
i
=
0
;
i
<
nargs
;
i
++
)
{
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: argument #%d types are %u -> %u
\n
"
,
i
,
input_typeids
[
i
],
func_typeids
[
i
]);
#endif
if
(
input_typeids
[
i
]
!=
func_typeids
[
i
])
if
(
input_typeids
[
i
]
!=
func_typeids
[
i
])
{
{
...
@@ -175,31 +136,14 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
...
@@ -175,31 +136,14 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
* through...
* through...
*/
*/
if
(
IS_BINARY_COMPATIBLE
(
input_typeids
[
i
],
func_typeids
[
i
]))
if
(
IS_BINARY_COMPATIBLE
(
input_typeids
[
i
],
func_typeids
[
i
]))
{
;
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: argument #%d type %s is known to be convertible to type %s
\n
"
,
i
,
typeidTypeName
(
input_typeids
[
i
]),
typeidTypeName
(
func_typeids
[
i
]));
#endif
}
/* don't know what to do for the output type? then quit... */
/* don't know what to do for the output type? then quit... */
else
if
(
func_typeids
[
i
]
==
InvalidOid
)
else
if
(
func_typeids
[
i
]
==
InvalidOid
)
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: output OID func_typeids[%u] is zero
\n
"
,
i
);
#endif
return
false
;
return
false
;
}
/* don't know what to do for the input type? then quit... */
/* don't know what to do for the input type? then quit... */
else
if
(
input_typeids
[
i
]
==
InvalidOid
)
else
if
(
input_typeids
[
i
]
==
InvalidOid
)
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: input OID input_typeids[%u] is zero
\n
"
,
i
);
#endif
return
false
;
return
false
;
}
/*
/*
* if not unknown input type, try for explicit conversion
* if not unknown input type, try for explicit conversion
* using functions...
* using functions...
...
@@ -223,51 +167,13 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
...
@@ -223,51 +167,13 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
* should also check the function return type just to be
* should also check the function return type just to be
* safe...
* safe...
*/
*/
if
(
HeapTupleIsValid
(
ftup
))
if
(
!
HeapTupleIsValid
(
ftup
))
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: found function %s(%s) to convert argument #%d
\n
"
,
typeidTypeName
(
func_typeids
[
i
]),
typeidTypeName
(
input_typeids
[
i
]),
i
);
#endif
}
else
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: did not find function %s(%s) to convert argument #%d
\n
"
,
typeidTypeName
(
func_typeids
[
i
]),
typeidTypeName
(
input_typeids
[
i
]),
i
);
#endif
return
false
;
return
false
;
}
}
else
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: argument #%d type is %u (UNKNOWN)
\n
"
,
i
,
input_typeids
[
i
]);
#endif
}
}
tp
=
typeidType
(
input_typeids
[
i
]);
tp
=
typeidType
(
input_typeids
[
i
]);
if
(
typeTypeFlag
(
tp
)
==
'c'
)
if
(
typeTypeFlag
(
tp
)
==
'c'
)
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: typeTypeFlag for %s is 'c'
\n
"
,
typeidTypeName
(
input_typeids
[
i
]));
#endif
return
false
;
return
false
;
}
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: conversion from %s to %s is possible
\n
"
,
typeidTypeName
(
input_typeids
[
i
]),
typeidTypeName
(
func_typeids
[
i
]));
#endif
}
else
{
#ifdef PARSEDEBUG
printf
(
"can_coerce_type: argument #%d type IDs %u match
\n
"
,
i
,
input_typeids
[
i
]);
#endif
}
}
}
}
...
@@ -396,9 +302,6 @@ PreferredType(CATEGORY category, Oid type)
...
@@ -396,9 +302,6 @@ PreferredType(CATEGORY category, Oid type)
result
=
UNKNOWNOID
;
result
=
UNKNOWNOID
;
break
;
break
;
}
}
#ifdef PARSEDEBUG
printf
(
"PreferredType- (%d) preferred type is %s
\n
"
,
category
,
typeidTypeName
(
result
));
#endif
return
result
;
return
result
;
}
/* PreferredType() */
}
/* PreferredType() */
...
...
src/backend/tcop/postgres.c
View file @
9710995f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.11
3 1999/05/13 07:28:46 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.11
4 1999/05/22 02:55:58 momjian
Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -215,7 +215,7 @@ InteractiveBackend(char *inBuf)
...
@@ -215,7 +215,7 @@ InteractiveBackend(char *inBuf)
* display a prompt and obtain input from the user
* display a prompt and obtain input from the user
* ----------------
* ----------------
*/
*/
printf
(
"> "
);
printf
(
"
backend
> "
);
fflush
(
stdout
);
fflush
(
stdout
);
for
(;;)
for
(;;)
...
@@ -1485,7 +1485,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
...
@@ -1485,7 +1485,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if
(
!
IsUnderPostmaster
)
if
(
!
IsUnderPostmaster
)
{
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.11
3 $ $Date: 1999/05/13 07:28:46
$
\n
"
);
puts
(
"$Revision: 1.11
4 $ $Date: 1999/05/22 02:55:58
$
\n
"
);
}
}
/* ----------------
/* ----------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment