Re: command tag logging - Mailing list pgsql-admin

From Tom Lane
Subject Re: command tag logging
Date
Msg-id 4083.1274980525@sss.pgh.pa.us
Whole thread Raw
In response to Re: command tag logging  (alvherre <alvherre@commandprompt.com>)
List pgsql-admin
alvherre <alvherre@commandprompt.com> writes:
> Excerpts from Tom Lane's message of jue may 27 12:49:49 -0400 2010:
>> That is in the right place, isn't it.  That would suggest that
>> get_ps_display() is returning a wrong length on Ray's machine.
>> It works okay here, but since that's platform-specific code that
>> hardly proves much.  Ray, what platform is this exactly?

> FWIW it fails for me too (Debian running Linux 2.6.32).

Hmm.  It seems like the %.*s change could only have affected things if
the PS display area contains \0 characters before the theoretical end
of the string.  Which it shouldn't, once we've set the display, but
Ray is only reporting this for log_connection output which might come
out before that.

In any case it strikes me that get_ps_display() is designed on the
assumption that it needn't be particularly fast, but using its result
in log_line_prefix is a place in which performance could indeed matter.
Maybe we should go to some effort to track the intended display string
length explicitly so we could avoid the mucking about in
get_ps_display().

            regards, tom lane

pgsql-admin by date:

Previous
From: Nilesh Govindarajan
Date:
Subject: Re: How to add constraints without validating data.
Next
From: Ray Stell
Date:
Subject: Re: command tag logging