aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-11 23:45:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-11 23:45:35 +0000
commit4951a8826d4f7731c7650af447e673e210991189 (patch)
treeea7ba24261e7e05cd9eec8ad32ae0ad5a28279cd /src/backend/tcop/postgres.c
parent66fd8f854fdc3faa30e4015020268217b4bb6747 (diff)
downloadpostgresql-4951a8826d4f7731c7650af447e673e210991189.tar.gz
postgresql-4951a8826d4f7731c7650af447e673e210991189.zip
copyObject() and equal() now know about all parse-time node types,
including utility statements. Still can't copy or compare executor state, but at present that doesn't seem to be necessary. This makes it possible to execute most (all?) utility statements in plpgsql. Had to change parsetree representation of CreateTrigStmt so that it contained only legal Nodes, and not bare string constants.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e87492fe553..1c9095d69f7 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.170 2000/07/17 03:05:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.171 2000/08/11 23:45:35 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -417,21 +417,13 @@ pg_parse_and_rewrite(char *query_string, /* string to execute */
* trees. The present (bizarre) implementation of UNION/INTERSECT/EXCEPT
* doesn't run analysis of the second and later subqueries until rewrite,
* so we'd get false failures on these queries if we did it beforehand.
- *
- * Currently, copyObject doesn't know about most of the utility query
- * types, so suppress the check until that can be fixed... it should
- * be fixed, though.
*/
- if (querytree_list &&
- ((Query *) lfirst(querytree_list))->commandType != CMD_UTILITY)
- {
- new_list = (List *) copyObject(querytree_list);
- /* This checks both copyObject() and the equal() routines... */
- if (! equal(new_list, querytree_list))
- elog(NOTICE, "pg_parse_and_rewrite: copyObject failed on parse tree");
- else
- querytree_list = new_list;
- }
+ new_list = (List *) copyObject(querytree_list);
+ /* This checks both copyObject() and the equal() routines... */
+ if (! equal(new_list, querytree_list))
+ elog(NOTICE, "pg_parse_and_rewrite: copyObject failed on parse tree");
+ else
+ querytree_list = new_list;
#endif
if (Debug_print_rewritten)
@@ -1412,7 +1404,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.170 $ $Date: 2000/07/17 03:05:14 $\n");
+ puts("$Revision: 1.171 $ $Date: 2000/08/11 23:45:35 $\n");
}
/*