Index: src/backend/tcop/postgres.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/tcop/postgres.c,v retrieving revision 1.318 diff -c -c -r1.318 postgres.c *** src/backend/tcop/postgres.c 20 Mar 2003 07:02:10 -0000 1.318 --- src/backend/tcop/postgres.c 21 Mar 2003 05:14:15 -0000 *************** *** 553,559 **** MemoryContext parse_context) /* context for * parsetrees */ { ! bool xact_started; MemoryContext oldcontext; List *parsetree_list, *parsetree_item; --- 553,559 ---- MemoryContext parse_context) /* context for * parsetrees */ { ! bool xact_started, was_parsetree = false; MemoryContext oldcontext; List *parsetree_list, *parsetree_item; *************** *** 618,623 **** --- 618,624 ---- List *querytree_list, *querytree_item; + was_parsetree = true; /* * First we set the command-completion tag to the main query (as * opposed to each of the others that may be generated by analyze *************** *** 927,932 **** --- 928,936 ---- EndCommand(commandTag, dest); } /* end loop over parsetrees */ + if (!was_parsetree && IsUnderPostmaster) + NullCommand(dest); + /* * Close down transaction statement, if one is open. (Note that this * will only happen if the querystring was empty.) *************** *** 1995,2030 **** * 'Q' indicates a user query */ case 'Q': ! if (strspn(parser_input->data, " \t\r\n") == parser_input->len) ! { ! /* ! * if there is nothing in the input buffer, don't ! * bother trying to parse and execute anything; just ! * send back a quick NullCommand response. ! */ ! if (IsUnderPostmaster) ! NullCommand(Remote); ! } ! else ! { ! /* ! * otherwise, process the input string. ! * ! * Note: transaction command start/end is now done within ! * pg_exec_query_string(), not here. ! */ ! if (log_statement_stats) ! ResetUsage(); ! pgstat_report_activity(parser_input->data); ! pg_exec_query_string(parser_input, ! whereToSendOutput, ! QueryContext); ! if (log_statement_stats) ! ShowUsage("QUERY STATISTICS"); ! } break; /* --- 1999,2021 ---- * 'Q' indicates a user query */ case 'Q': ! /* ! * otherwise, process the input string. ! * ! * Note: transaction command start/end is now done within ! * pg_exec_query_string(), not here. ! */ ! if (log_statement_stats) ! ResetUsage(); ! pgstat_report_activity(parser_input->data); ! pg_exec_query_string(parser_input, ! whereToSendOutput, ! QueryContext); ! if (log_statement_stats) ! ShowUsage("QUERY STATISTICS"); break; /*