Re: SPI_psprintf and SPI_pstrdup

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Jacob Rief <jacob(dot)rief(at)gmx(dot)at>
Subject: Re: SPI_psprintf and SPI_pstrdup
Date: 2007-04-24 21:08:57
Message-ID: 200704242308.57838.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-04-24 21:10:33 Re: SPI_psprintf and SPI_pstrdup
Previous Message Jacob Rief 2007-04-24 20:51:04 SPI_psprintf and SPI_pstrdup