Re: difficulty extracting variable-sized field on triggered row

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Glen W(dot) Mabey" <Glen(dot)Mabey(at)swri(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: difficulty extracting variable-sized field on triggered row
Date: 2007-12-04 15:10:21
Message-ID: 162867790712040710t46f2151s4d238e87540d614d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/12/2007, Glen W. Mabey <Glen(dot)Mabey(at)swri(dot)org> wrote:
> Hello,
>
> I have been trying to write a trigger in C operating on each row
> that would (as a first step) copy a field of type TEXT into a text*
> variable.
>
> I think that I've got the SPI_connect, SPI_fnumber, and SPI_getbinval
> calls correct, but this gives me a Datum.
>
> How do I convert a Datum to a text*?
>

use macro DatumGetPointer(datum)

Pavel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glen W. Mabey 2007-12-04 15:26:46 Re: difficulty extracting variable-sized field on triggered row
Previous Message Ted Byers 2007-12-04 14:58:32 Re: stored procedures and dynamic queries