appendPQExpBufferVA vs appendStringInfoVA - Mailing list pgsql-hackers

From David Rowley
Subject appendPQExpBufferVA vs appendStringInfoVA
Date
Msg-id CAApHDvqcnkQNqqLzAhDMaP1TcRkhgHb4EPrYSq51DAgnmxPCPQ@mail.gmail.com
Whole thread Raw
Responses Re: appendPQExpBufferVA vs appendStringInfoVA  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom commited some changes to appendStringInfoVA a few weeks ago which allows it to return the required buffer size if the current buffer is not big enough.

On looking at appendPQExpBufferVA I'm thinking it would be nice if it could make use of the new pvsnprintf function to bring the same potential performance improvement in to there too. My vision of how appendPQExpBufferVA would look after the change is pretty much exactly the same as appendStringInfoVA, which make me think... Why do we even have appendPQExpBufferVA ? The only reason that I can think of is that it is used in front end applications and allocates memory differently... Is this the only reason or is there some other special reason for this function that I can't think of?

If someone wants to give me some guidance on how or if all this should re-factored, I'll happily supply a patch. 

Regards

David Rowley

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #8573: int4range memory consumption
Next
From: Tom Lane
Date:
Subject: Re: appendPQExpBufferVA vs appendStringInfoVA