Re: Cleaner API for appendStringInfoVA

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marko Kreen" <markokr(at)gmail(dot)com>
Cc: "Postgres Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Cleaner API for appendStringInfoVA
Date: 2007-11-23 17:03:56
Message-ID: 11177.1195837436@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Marko Kreen" <markokr(at)gmail(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-11-23 17:12:37 Re: parse_expr.c:typecast_expression:return immediate on NULL input
Previous Message Tom Lane 2007-11-23 16:55:42 Re: plpython crash on exception