diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-06-01 23:27:12 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-06-01 23:27:12 +0000 |
commit | 7b21f26ea7240c27523c74576bb0ff239493e354 (patch) | |
tree | 69ae84c93e06cadeafad010278dfc9f879909951 /src/backend/tcop/postgres.c | |
parent | 64f40008ec618308f2b7f6d6389e9c1a08b18597 (diff) | |
download | postgresql-7b21f26ea7240c27523c74576bb0ff239493e354.tar.gz postgresql-7b21f26ea7240c27523c74576bb0ff239493e354.zip |
Fix log_statement to properly recognize SELECT INTO and CREATE TABLE AS
and DDL statements.
Backpatch fix to 8.0.X.
Per report from Murthy Kambhampaty
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index d640c3b602c..b84819b52b2 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.440 2004/12/31 22:01:16 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.440.4.1 2005/06/01 23:27:12 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -495,7 +495,8 @@ pg_parse_query(const char *query_string) if (IsA(parsetree, PrepareStmt)) parsetree = (Node *) (((PrepareStmt *) parsetree)->query); - if (IsA(parsetree, SelectStmt)) + if (IsA(parsetree, SelectStmt) && + ((SelectStmt *) parsetree)->into == NULL) continue; /* optimization for frequent command */ if (log_statement == LOGSTMT_MOD && @@ -513,6 +514,7 @@ pg_parse_query(const char *query_string) } commandTag = CreateCommandTag(parsetree); if (strncmp(commandTag, "CREATE ", strlen("CREATE ")) == 0 || + IsA(parsetree, SelectStmt) || /* SELECT INTO, CREATE AS */ strncmp(commandTag, "ALTER ", strlen("ALTER ")) == 0 || strncmp(commandTag, "DROP ", strlen("DROP ")) == 0 || IsA(parsetree, GrantStmt) || /* GRANT or REVOKE */ |