Re: Initializing Datums for use with SPI_execute_plan - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Initializing Datums for use with SPI_execute_plan
Date
Msg-id 20060919193427.GE1789@svana.org
Whole thread Raw
In response to Re: Initializing Datums for use with SPI_execute_plan  ("Jack Orenstein" <jack.orenstein@gmail.com>)
Responses Re: Initializing Datums for use with SPI_execute_plan
List pgsql-general
On Tue, Sep 19, 2006 at 01:27:56PM -0400, Jack Orenstein wrote:
> On 9/18/06, Jack Orenstein <jack.orenstein@gmail.com> wrote:
> >---------- Forwarded message ----------
> >From: Andrew - Supernews <andrew@supernews.net>
> ...
> > Jack> I have an int8 that I need as a Datum for use with
> > Jack> SPI_execute_plan.
> >
> >Int64GetDatum(your_variable)
>
> which then has to be pfree'd, correct?

Possibly, it probably depends on the architechture. The memory is being
allocated in a per-call context IIRC so it'll be freed at the end of
the function anyway. I wouldn't worry about it.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Load a csv file into a pgsql table
Next
From: "Jack Orenstein"
Date:
Subject: Re: Initializing Datums for use with SPI_execute_plan