pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Clay Luther <claycle@cisco.com>
Cc: Nigel J. Andrews <nandrews@investsystems.co.uk>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Dissecting Tuples in C
Date: Thu, 26 Jun 2003 15:23:58 -0700
Message-ID: <3EFB727E.50803@joeconway.com> (raw)
In-Reply-To: <1056665701.22881.41.camel@gkar>
References: <Pine.LNX.4.21.0306262152010.15389-100000@ponder.fairway2k.co.uk>
	<1056665701.22881.41.camel@gkar>

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




view thread (4+ messages)

Message-ID: <3EFB727E.50803@joeconway.com>
Permalink:  ../3EFB727E.50803@joeconway.com/
Also on:    postgresql.org/message-id/3EFB727E.50803@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mail@joeconway.com, claycle@cisco.com, nandrews@investsystems.co.uk
  Subject: Re: Dissecting Tuples in C
  In-Reply-To: <3EFB727E.50803@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox