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