Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitdb01f79

Browse 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 properlyclear the value, and document the interaction.Reported-by: Fujii Masao, Michael PaquierDiscussion:https://postgr.es/m/YHPkU8hFi4no4NSw@paquier.xyzAuthor: Julien Rouhaud
1 parent9660834 commitdb01f79

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

‎doc/src/sgml/config.sgml

Lines 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

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

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp