Skip site navigation (1) Skip section navigation (2)

Re: SPI_psprintf and SPI_pstrdup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jacob Rief <jacob(dot)rief(at)gmx(dot)at>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: SPI_psprintf and SPI_pstrdup
Date: 2007-04-24 21:10:33
Message-ID: 8945.1177449033@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Jacob Rief <jacob(dot)rief(at)gmx(dot)at> writes:
> The Apache runtime library, which is using a similar concept for
> allocating heap-based memory out of a pool, has some since utility
> functions, named apr_psprintf and apr_pstrdup.

SPI_palloc might possibly be worth the trouble, but the other thing
is duplicative of the StringInfo routines, and I do not think it's
a good idea to provide duplicate ways to accomplish the same thing.
It's just more code to maintain and more things for newcomers to
learn about when trying to read someone else's code.

Also, proposed API additions without any documentation are not acceptable.
The docs addition for SPI_palloc would be substantially larger than the
code itself; is it worth the trouble?

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Zeugswetter Andreas ADI SDDate: 2007-04-25 08:00:16
Subject: Re: [HACKERS] Full page writes improvement, code update
Previous:From: Peter EisentrautDate: 2007-04-24 21:08:57
Subject: Re: SPI_psprintf and SPI_pstrdup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group