Re: Add %z support to elog/ereport? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Add %z support to elog/ereport?
Date
Msg-id CA+Tgmobp7ieOisYTHR-Gm3nVzMFbhN2niQ6f-6=dWhJdZw-H7Q@mail.gmail.com
Whole thread Raw
In response to Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Mon, Nov 11, 2013 at 10:50 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> Hi,
>
> I'd like to add support for the length modifier %z. Linux' manpages
> describes it as:
>  z      A  following  integer conversion corresponds to a size_t or ssize_t argument.
>
> Since gcc's printf format checks understand it, we can add support for
> it similar to the way we added %m support.

I seem to recall that our %m support involves rewriting the error
string twice, which I think is actually kind of expensive if, for
example, you've got a loop around a PL/pgsql EXCEPTION block.  I'd
actually like to find a way to get rid of the existing %m support,
maybe by having a flag that says "oh, and by the way append the system
error to my format string"; or by changing %m to %s and having the
caller pass system_error_string() or similar for that format position.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Add %z support to elog/ereport?
Next
From: Andres Freund
Date:
Subject: Re: Add %z support to elog/ereport?