Re: Dissecting Tuples in C - Mailing list pgsql-interfaces

From Joe Conway
Subject Re: Dissecting Tuples in C
Date
Msg-id 3EFB727E.50803@joeconway.com
Whole thread Raw
In response to Re: Dissecting Tuples in C  (Clay Luther <claycle@cisco.com>)
List 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



pgsql-interfaces by date:

Previous
From: Clay Luther
Date:
Subject: Re: Dissecting Tuples in C
Next
From: Philip Yarra
Date:
Subject: ECPG thread success (kind of) on Linux