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

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 (view raw or flat)
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

pgsql-patches by date

Next:From: Tom LaneDate: 2007-04-24 21:10:33
Subject: Re: SPI_psprintf and SPI_pstrdup
Previous:From: Jacob RiefDate: 2007-04-24 20:51:04
Subject: SPI_psprintf and SPI_pstrdup

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