diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-04-18 00:52:23 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-04-18 00:52:23 +0000 |
commit | 5bd59b9c0afd81e5ec636b7b475ef55ad16b12fb (patch) | |
tree | b143d7623bc389e57f59fb3c9f0e72183db1d418 /src/backend/tcop/postgres.c | |
parent | 0a8739495664d02af82a08960cfd17fad2cb9508 (diff) | |
download | postgresql-5bd59b9c0afd81e5ec636b7b475ef55ad16b12fb.tar.gz postgresql-5bd59b9c0afd81e5ec636b7b475ef55ad16b12fb.zip |
Document that errors are not output by log_statement (was they were in
8.0), and add as suggestion to use log_min_error_statement for this
purpose. I also fixed the code so the first EXECUTE has it's prepare,
rather than the last which is what was in the current code. Also remove
"protocol" prefix for SQL EXECUTE output because it is not accurate.
Backpatch to 8.1.X.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index df9ef8983a0..3c24fa532a6 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.483 2006/04/04 19:35:35 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.484 2006/04/18 00:52:23 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -586,19 +586,21 @@ log_after_parse(List *raw_parsetree_list, const char *query_string, /* * For the first EXECUTE we find, record the client statement used by - * the PREPARE. + * the PREPARE. PREPARE doesn't save the parse tree so we have no + * way to conditionally output based on the type of query prepared. */ if (IsA(parsetree, ExecuteStmt)) { ExecuteStmt *stmt = (ExecuteStmt *) parsetree; PreparedStatement *entry; - if ((entry = FetchPreparedStatement(stmt->name, false)) != NULL && + if (*prepare_string == NULL && + (entry = FetchPreparedStatement(stmt->name, false)) != NULL && entry->query_string) { *prepare_string = palloc(strlen(entry->query_string) + - strlen(" [protocol PREPARE: %s]") - 1); - sprintf(*prepare_string, " [protocol PREPARE: %s]", + strlen(" [PREPARE: %s]") - 2 + 1); + sprintf(*prepare_string, " [PREPARE: %s]", entry->query_string); } } |