aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/src/sgml/config.sgml9
-rw-r--r--src/backend/tcop/postgres.c12
2 files changed, 12 insertions, 9 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 3a827002f74..774aed66a82 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.52 2006/03/10 19:10:47 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.53 2006/04/18 00:52:22 momjian Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
@@ -2758,9 +2758,10 @@ SELECT * FROM parent WHERE key = 2400;
<note>
<para>
The <command>EXECUTE</command> statement is not considered a
- <literal>ddl</> or <literal>mod</> statement. When it is logged,
- only the name of the prepared statement is reported, not the
- actual prepared statement.
+ <literal>ddl</> or <literal>mod</> statement. Statements that
+ generate errors are not logged. Set
+ <varname>log_min_error_statement</> to <literal>error</> to
+ log such statements.
</para>
<para>
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);
}
}