Re: compute_query_id - Mailing list pgsql-general

From Julien Rouhaud
Subject Re: compute_query_id
Date
Msg-id 20210617153441.klssqpnou77zu5bd@nol
Whole thread Raw
In response to Re: compute_query_id  (Vijaykumar Jain <vijaykumarjain.github@gmail.com>)
List pgsql-general
On Thu, Jun 17, 2021 at 08:57:02PM +0530, Vijaykumar Jain wrote:
>
> test=# show log_line_prefix;
>         log_line_prefix
> --------------------------------
>  [timestamp=%t] [query_id=%Q] :
> (1 row)
> 
> test=# show compute_query_id;
>  compute_query_id
> ------------------
>  on
> (1 row)
> 
> test=# show log_statement;
>  log_statement
> ---------------
>  all
> (1 row)
> 
> ************************************* corrects myself
> ..... ok now it works, when i set log_min_duration_statement =0 to log
> all statements.
> 
> test=# show log_min_duration_statement;
>  log_min_duration_statement
> ----------------------------
>  0
> (1 row)

Yes, unfortunately log_statements is not compatible with compute_query_id.
This is documented at
https://www.postgresql.org/docs/devel/runtime-config-logging.html#GUC-LOG-LINE-PREFIX:

> The %Q escape always reports a zero identifier for lines output by
> log_statement because log_statement generates output before an identifier can
> be calculated, including invalid statements for which an identifier cannot be
> calculated.



pgsql-general by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: compute_query_id
Next
From: Alexey Bashtanov
Date:
Subject: Re: Streaming replication: PANIC on tertiary when secondary promoted