pgAdmin crashes when client_min_messages is set in postgresql.conf

Started by My Dejaover 22 years ago7 messagespatches
Jump to latest
#1My Deja
mydeja@achimota.com

I am trying to get some query trees to appear in the PostgreSQL log and
in order to that I have set
client_min_messages = DEBUG1 in order to use the following settings
debug_print_parse, debug_print_rewritten, or debug_print_plan which are
required for the query tree to show up in the log.

pgAdmin crashes whenever I set that option. I tried a few times and I am
sure of it.
I am using PostgreSQL 7.4 under Cygwin on a Windows 2000 machine, but I
don't think that has any relevance.

I am sorry if this appears in some formatted font, I can't seem to set
the mail client to change to plain text.

PS. I wanted to set that option because I want to learn about the rule
system. Any pointers in that area?

#2Andreas Pflug
pgadmin@pse-consulting.de
In reply to: My Deja (#1)
Re: pgAdmin crashes when client_min_messages is

My Deja wrote:

I am trying to get some query trees to appear in the PostgreSQL log
and in order to that I have set
client_min_messages = DEBUG1 in order to use the following settings
debug_print_parse, debug_print_rewritten, or debug_print_plan which
are required for the query tree to show up in the log.

pgAdmin crashes whenever I set that option. I tried a few times and I
am sure of it.
I am using PostgreSQL 7.4 under Cygwin on a Windows 2000 machine, but
I don't think that has any relevance.

I can confirm this problem. Apparently the flood of debug notices will
kill pgAdmin3 after a while.
I'll have a deeper look into this later. Until then, do *not* set these
options in postgresql.conf. Instead, set these options per user (if you
want to observe a user *different* from the one you're using with
pgAdmin3), or set these options in the query tool prior to executing
your queries to inspect.

Regards,
Andreas

#3Andreas Pflug
pgadmin@pse-consulting.de
In reply to: Andreas Pflug (#2)
libpq endless loop if client_min_messages=debug1

My Deja wrote:

I am trying to get some query trees to appear in the PostgreSQL log
and in order to that I have set
client_min_messages = DEBUG1 in order to use the following settings
debug_print_parse, debug_print_rewritten, or debug_print_plan which
are required for the query tree to show up in the log.

pgAdmin crashes whenever I set that option. I tried a few times and I
am sure of it.
I am using PostgreSQL 7.4 under Cygwin on a Windows 2000 machine, but
I don't think that has any relevance.

I reproduced this problem with 7.5 head backend and libpq under win32
and Linux, and found that the problem is pqParseInput3 expecting a
message length >= 30000 only for message types 'T', 'D' and 'd', but not
'N'. In the case tested above, the message will be 49336 bytes long,
causing an endless loop in PQexecFinish because PQgetResult will deliver
the same broken message forever.

The attached patch fixes this. I wonder if there are additional message
types that might be longer?

Regards,
Andreas

Attachments:

fe-protocol3.c.patchtext/plain; name=fe-protocol3.c.patchDownload+1-1
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Pflug (#3)
Re: [PATCHES] libpq endless loop if client_min_messages=debug1

Andreas Pflug <pgadmin@pse-consulting.de> writes:

I reproduced this problem with 7.5 head backend and libpq under win32
and Linux, and found that the problem is pqParseInput3 expecting a
message length >= 30000 only for message types 'T', 'D' and 'd', but not
'N'.

Oops. Good catch.

regards, tom lane

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Pflug (#3)
Re: [PATCHES] libpq endless loop if client_min_messages=debug1

Andreas Pflug <pgadmin@pse-consulting.de> writes:

The attached patch fixes this. I wonder if there are additional message
types that might be longer?

We should allow error messages to be long too, I guess, and I also added
NOTIFY messages since there's no telling what people might try to do
with the data payload string once we implement that.

I also fixed the underlying infinite-loop problem.

regards, tom lane

#6My Deja
mydeja@achimota.com
In reply to: Andreas Pflug (#2)
Re: pgAdmin crashes when client_min_messages is

Andreas Pflug wrote:

My Deja wrote:

I am trying to get some query trees to appear in the PostgreSQL log
and in order to that I have set
client_min_messages = DEBUG1 in order to use the following settings
debug_print_parse, debug_print_rewritten, or debug_print_plan which
are required for the query tree to show up in the log.

pgAdmin crashes whenever I set that option. I tried a few times and I
am sure of it.
I am using PostgreSQL 7.4 under Cygwin on a Windows 2000 machine, but
I don't think that has any relevance.

I can confirm this problem. Apparently the flood of debug notices will
kill pgAdmin3 after a while.
I'll have a deeper look into this later. Until then, do *not* set these
options in postgresql.conf. Instead, set these options per user (if you
want to observe a user *different* from the one you're using with
pgAdmin3), or set these options in the query tool prior to executing
your queries to inspect.

How are these options set in the query tool? I can see Explain Options
-Verbose/Analyze on the menu. Which one of these does the trick?

Thanks for the reply

My Deja

Show quoted text

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#7Andreas Pflug
pgadmin@pse-consulting.de
In reply to: My Deja (#6)
Re: pgAdmin crashes when client_min_messages is

My Deja wrote:

How are these options set in the query tool? I can see Explain Options
-Verbose/Analyze on the menu. Which one of these does the trick?

No trick. You type "SET ...." and hit F5.

Regards,
Andreas