Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db01f79

Browse filesBrowse files
committed
Fix interaction of log_line_prefix's query_id and log_statement
log_statement is issued before query_id can be computed, so properly clear the value, and document the interaction. Reported-by: Fujii Masao, Michael Paquier Discussion: https://postgr.es/m/YHPkU8hFi4no4NSw@paquier.xyz Author: Julien Rouhaud
1 parent 9660834 commit db01f79
Copy full SHA for db01f79

File tree

Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎doc/src/sgml/config.sgml‎

Copy file name to clipboardExpand all lines: doc/src/sgml/config.sgml
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7139,6 +7139,16 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
71397139
</programlisting>
71407140
</para>
71417141
</tip>
7142+
7143+
<note>
7144+
<para>
7145+
The <literal>%Q</literal> escape always reports a zero identifier
7146+
for lines output by <xref linkend="guc-log-statement"/> because
7147+
<varname>log_statement</varname> generates output before an
7148+
identifier can be calculated, including invalid statements for
7149+
which an identifier cannot be calculated.
7150+
</para>
7151+
</note>
71427152
</listitem>
71437153
</varlistentry>
71447154

Collapse file

‎src/backend/utils/activity/backend_status.c‎

Copy file name to clipboardExpand all lines: src/backend/utils/activity/backend_status.c
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ pgstat_bestart(void)
398398
lbeentry.st_state = STATE_UNDEFINED;
399399
lbeentry.st_progress_command = PROGRESS_COMMAND_INVALID;
400400
lbeentry.st_progress_command_target = InvalidOid;
401+
lbeentry.st_query_id = UINT64CONST(0);
401402

402403
/*
403404
* we don't zero st_progress_param here to save cycles; nobody should

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.