Skip to content

Commit f443258

Browse files
committed
Only call log_after_parse() if necessary.
1 parent bc24d5b commit f443258

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/tcop/postgres.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.500 2006/08/29 02:11:29 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.501 2006/08/29 02:32:41 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -871,7 +871,9 @@ exec_simple_query(const char *query_string)
871871
parsetree_list = pg_parse_query(query_string);
872872

873873
/* Log immediately if dictated by log_statement */
874-
was_logged = log_after_parse(parsetree_list, query_string, &prepare_string);
874+
if (log_statement != LOGSTMT_NONE || log_duration ||
875+
log_min_duration_statement >= 0)
876+
was_logged = log_after_parse(parsetree_list, query_string, &prepare_string);
875877

876878
/*
877879
* Switch back to transaction context to enter the loop.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy