-
+
Server Configuration
The EXECUTE statement is not considered a
- ddl> or mod> statement. When it is logged,
- only the name of the prepared statement is reported, not the
- actual prepared statement.
+ ddl> or mod> statement. Statements that
+ generate errors are not logged. Set
+ log_min_error_statement> to error> to
+ log such statements.
*
*
* 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
/*
* 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);
}
}