Re: Cleaner API for appendStringInfoVA - Mailing list pgsql-patches

From Tom Lane
Subject Re: Cleaner API for appendStringInfoVA
Date
Msg-id 11177.1195837436@sss.pgh.pa.us
Whole thread Raw
In response to Cleaner API for appendStringInfoVA  ("Marko Kreen" <markokr@gmail.com>)
Responses Re: Cleaner API for appendStringInfoVA
List pgsql-patches
"Marko Kreen" <markokr@gmail.com> writes:
> Attached patch moves decision how much more room to allocate
> from callers of appendStringInfoVA to inside the function,
> where more info is available.

This is by no stretch of the imagination "cleaner".

> On systems with broken vsnprintf() it falls back
> to doubleing the buffer.

The problem with this is that you are defining one particular vsnprintf
behavior as "non broken", without any evidence for that opinion.
(Indeed, one could argue that that behavior is contradictory to what
the Single Unix Spec says, although the SUS is a bit vague about it.)

Our own vsnprintf doesn't follow that behavior, for instance, so we
couldn't even get there by forcing it to be used always.

I'd want to see some significant evidence of a performance issue
before considering hacking this up like this.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpython crash on exception
Next
From: Tom Lane
Date:
Subject: Re: parse_expr.c:typecast_expression:return immediate on NULL input