Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;' - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'
Date
Msg-id 9787.1589124821@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPAREsid_sisisinst FROM :select_anw;'  (Matthias Apitz <guru@unixarea.de>)
Responses Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPAREsid_sisisinst FROM :select_anw;'
List pgsql-general
Matthias Apitz <guru@unixarea.de> writes:
> 1. In addition to the above code, can I get somehow the connecting client's PID? If

Not in any portable way.  If you believe that the offending client is on
the local system, you could try building something involving netstat,
lsof, etc.  getpeereid() might be useful too.

> 2. Can I get something out of the buffer of the startup packet?

I'm fairly sure that at the point where the error is thrown, we've
only read the putative length word, so there's nothing buffered.
But sure, you could try to collect whatever is available from the
socket and dump that --- probably a hex dump would be advisable,
because it'll contain \0 bytes.  Seems like a good idea.

            regards, tom lane



pgsql-general by date:

Previous
From: Matthias Apitz
Date:
Subject: Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPAREsid_sisisinst FROM :select_anw;'
Next
From: Mary Johnson
Date:
Subject: what to log in csvlogs