Re: Log query parameters for terminated execute

Поиск
Список
Период
Сортировка
От Sergei Kornilov
Тема Re: Log query parameters for terminated execute
Дата
Msg-id 35308731532344646@myt1-bc8ef50fb490.qloud-c.yandex.net
обсуждение исходный текст
Ответ на Re: Log query parameters for terminated execute  (Ibrar Ahmed <ibrar.ahmad@gmail.com>)
Ответы Re: Log query parameters for terminated execute
Список pgsql-hackers
Hello!

>> After shutdown signal we must be in aborted state, so we mustn't call user-defined I/O functions. (quotation from
commentto errdetail_params in src/backend/tcop/postgres.c ). It seems i can not fix it with current design.
 
>
> No its not about calling the function after abort/shutdown. Just start the server and try to run the program, most of
thetime you will not get params.
 
>
>>> ERROR:  canceling statement due to lock timeout at character 13
>> Hm, "at character"? How can we get this message? I found only "canceling statement due to lock timeout" (without "at
character")ereport in src/backend/tcop/postgres.c
 
>> Maybe try .. catch in parse state, not in execute?
>
> Its really easy to reproduce, just lock the table form another session and run a "c" program to insert row in the
sametable.
 

So, I was right. We can got "canceling statement due to lock timeout at character 13" only in PARSE state. In parse
statewe have completely no parameters, we receive parameters only later in BIND message. I can not log data from
future.
And initially i did change only EXECUTE. Attached patch with similar change in BIND message, if this design is
acceptable.

Please test with logging command tag %i in log_line_prefix. Extended protocol has three different messages, each can be
canceledby timeout. But here is completely no parameters in PARSE and i did not change BIND in first patch.
 

regards, Sergei
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nikhil Sontakke
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [bug fix] Produce a crash dump before main() on Windows