Re: Dissecting Tuples in C

From: Joe Conway <mail(at)joeconway(dot)com>
To: Clay Luther <claycle(at)cisco(dot)com>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Dissecting Tuples in C
Date: 2003-06-26 22:23:58
Message-ID: 3EFB727E.50803@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Clay Luther wrote:
> Hrmmmm....let me be more clear.
>
> How do I get the TupleDesc for a HeapTuple, for example? The Trigger
> structure has HeapTuples, but I need the TupleDesc as well to be able to
> use functions like SPI_getvalue().
>

Take a look at ttdummy() in src/test/regress/regress.c.

Here's a snippet of the specific lines you need:
<snip>
TriggerData *trigdata = (TriggerData *) fcinfo->context;
rel = trigdata->tg_relation;
tupdesc = rel->rd_att;
</snip>

HTH,

Joe

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Philip Yarra 2003-06-27 00:45:46 ECPG thread success (kind of) on Linux
Previous Message Clay Luther 2003-06-26 22:15:01 Re: Dissecting Tuples in C