Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3065163266D for ; Thu, 27 May 2010 14:15:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 18156-08; Thu, 27 May 2010 17:15:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2AA5063221C; Thu, 27 May 2010 14:15:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o4RHFQJw004084; Thu, 27 May 2010 13:15:26 -0400 (EDT) To: alvherre cc: Ray Stell , pgsql-admin , pgsql-hackers Subject: Re: command tag logging In-reply-to: <1274979300-sup-5327@alvh.no-ip.org> References: <20100526210833.GA14469@cns.vt.edu> <1274908611-sup-6661@alvh.no-ip.org> <3713.1274978989@sss.pgh.pa.us> <1274979300-sup-5327@alvh.no-ip.org> Comments: In-reply-to alvherre message dated "Thu, 27 May 2010 12:59:17 -0400" Date: Thu, 27 May 2010 13:15:25 -0400 Message-ID: <4083.1274980525@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/271 X-Sequence-Number: 34744 alvherre 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