Re: Log query parameters for terminated execute

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Log query parameters for terminated execute
Date: 2018-07-23 14:37:54
Message-ID: 19844041532356674@sas1-02732547ccc0.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

23.07.2018, 17:08, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Sergei Kornilov <sk(at)zsrv(dot)org> writes:
>>  Please test with logging command tag %i in log_line_prefix. Extended protocol has three different messages, each can be canceled by timeout. But here is completely no parameters in PARSE and i did not change BIND in first patch.
>
> This patch scares me to death. It risks calling user-defined I/O
> functions in all sorts of weird places, particularly outside transactions,
> or in already-failed transactions, or with no ActiveSnapshot.
This is reason why i start thread with question how do it right way
As i wrote in beginning:
> i have no good idea how print ParamListInfo correctly. We can not use OidOutputFunctionCall in all cases, right?
Attached patch is just simple enough to illustrate one possible way.
I can further work with proper design, but i need idea how it should look.

> Separately from that concern: it appears to result in a substantial
> degradation of existing functionality in the places where you did
> s/errdetail/errdetail_log/. What was the reason for that?
This is my second question at thread beginning. Why used errdetail? We assume that the user wants to get their own parameters back (if he set client_min_messages to LOG)?

regards, Sergei

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2018-07-23 14:42:11 Re: How can we submit code patches that implement our (pending) patents?
Previous Message Robert Haas 2018-07-23 14:36:25 Re: Indicate anti-wraparound autovacuum in log_autovacuum_min_duration