Re: resetStringInfo - Mailing list pgsql-patches

From Joe Conway
Subject Re: resetStringInfo
Date
Msg-id 45E9C52C.6070802@joeconway.com
Whole thread Raw
In response to Re: resetStringInfo  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: resetStringInfo
List pgsql-patches
Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
>> Attached is a patch that makes a minor addition to the StringInfo API:
>> resetStringInfo(), which clears the current content of the StringInfo
>> but leaves it valid for future operations.
>
>> I needed this for an external project, but ISTM this would be worth
>> including in mainline:
>
> Sure.  I'm pretty sure there are a number of places currently doing this
> "by hand"; would you mind looking around to see if you can fix 'em up
> to use this function?

I have used pfree(var.data) combined with initStringInfo(&var) in a few
places (e.g. in tablefunc.c).

Joe

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_standby Error cleanup
Next
From: Neil Conway
Date:
Subject: Re: resetStringInfo