[PATCHES] SPI_psprintf and SPI_pstrdup

2007-04-24 Thread Jacob Rief
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. These functions allocate a memory-block out of a pool and print a formatted string into that block, or duplicate a

Re: [PATCHES] SPI_psprintf and SPI_pstrdup

2007-04-24 Thread Peter Eisentraut
Jacob Rief wrote: char *SPI_psprintf(const char *fmt, ...); allocates a block of memory out of the memory pool and prints a formatted string into it Such matters are best solved using the StringInfo API. SPI_pstrdup(const char *src); allocates a block of memory out of the memory pool and

Re: [PATCHES] SPI_psprintf and SPI_pstrdup

2007-04-24 Thread Tom Lane
Jacob Rief [EMAIL PROTECTED] 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