Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'
Date: 1998-11-09 15:27:27
Message-ID: 3428.910625247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> Does [stringinfo.c] remove the need for vsnprintf?

Not directly --- the functions it currently provides only know how to
append given strings onto a StringInfo object. There's no formatting
control.

I'm sure we could program around vsnprintf if we were determined
enough, but there isn't any other equally clean way to do what's
needed in tracing. Probably better to spend our effort on providing
a reliable emulation of it for platforms that haven't got it.
(BTW, I have no reason to think that the emulation we have is broken;
I was just objecting to starting to depend on it only a week or so
before a major release.)

Actually, what would be *really* whizzy is some way of sprintf'ing
into a StringInfo, with the ability to auto-expand the StringInfo as
needed. But that requires hooking into the low-level guts of printf,
and AFAIK there's no portable way to do it short of providing your
own complete printf implementation. Not worth it.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Goran Thyni 1998-11-09 16:27:03 Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'
Previous Message Sferacarta Software 1998-11-09 13:33:06 Re: [INTERFACES] limiting the rows selected in postgresql