Re: resetStringInfo

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: resetStringInfo
Date: 2007-03-03 18:57:48
Message-ID: 45E9C52C.6070802@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Neil Conway <neilc(at)samurai(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2007-03-03 19:33:12 Re: resetStringInfo
Previous Message Bruce Momjian 2007-03-03 18:50:52 Re: pg_standby Error cleanup