appendPQExpBufferVA vs appendStringInfoVA

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: appendPQExpBufferVA vs appendStringInfoVA
Date: 2013-11-02 01:02:12
Message-ID: CAApHDvqcnkQNqqLzAhDMaP1TcRkhgHb4EPrYSq51DAgnmxPCPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-11-02 01:27:53 Re: appendPQExpBufferVA vs appendStringInfoVA
Previous Message Tom Lane 2013-11-02 00:17:00 Re: [BUGS] BUG #8573: int4range memory consumption