Re: SPI_psprintf and SPI_pstrdup - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: SPI_psprintf and SPI_pstrdup
Date
Msg-id 200704242308.57838.peter_e@gmx.net
Whole thread Raw
In response to SPI_psprintf and SPI_pstrdup  (Jacob Rief <jacob.rief@gmx.at>)
List pgsql-patches
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 copies an
> existing string into it.

How is that different from pstrdup()?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-patches by date:

Previous
From: Jacob Rief
Date:
Subject: SPI_psprintf and SPI_pstrdup
Next
From: Tom Lane
Date:
Subject: Re: SPI_psprintf and SPI_pstrdup