88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.444 2005/05/24 04:18:04 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.445 2005/06/01 23:27:03 momjian Exp $
1212 *
1313 * NOTES
1414 * this is the "main" module of the postgres backend and
@@ -498,7 +498,8 @@ log_after_parse(List *raw_parsetree_list, const char *query_string,
498498 if (IsA (parsetree , PrepareStmt ))
499499 parsetree = (Node * ) (((PrepareStmt * ) parsetree )-> query );
500500
501- if (IsA (parsetree , SelectStmt ))
501+ if (IsA (parsetree , SelectStmt ) &&
502+ ((SelectStmt * ) parsetree )-> into == NULL )
502503 continue ; /* optimization for frequent command */
503504
504505 if (log_statement == LOGSTMT_MOD &&
@@ -514,6 +515,7 @@ log_after_parse(List *raw_parsetree_list, const char *query_string,
514515 if ((log_statement == LOGSTMT_MOD ||
515516 log_statement == LOGSTMT_DDL ) &&
516517 (strncmp (commandTag , "CREATE " , strlen ("CREATE " )) == 0 ||
518+ IsA (parsetree , SelectStmt ) || /* SELECT INTO, CREATE AS */
517519 strncmp (commandTag , "ALTER " , strlen ("ALTER " )) == 0 ||
518520 strncmp (commandTag , "DROP " , strlen ("DROP " )) == 0 ||
519521 IsA (parsetree , GrantStmt ) || /* GRANT or REVOKE */
0 commit comments