Re: SPI_psprintf and SPI_pstrdup - Mailing list pgsql-patches

From Tom Lane
Subject Re: SPI_psprintf and SPI_pstrdup
Date
Msg-id 8945.1177449033@sss.pgh.pa.us
Whole thread Raw
In response to SPI_psprintf and SPI_pstrdup  (Jacob Rief <jacob.rief@gmx.at>)
List pgsql-patches
Jacob Rief <jacob.rief@gmx.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

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: SPI_psprintf and SPI_pstrdup
Next
From: "Zeugswetter Andreas ADI SD"
Date:
Subject: Re: [HACKERS] Full page writes improvement, code update