X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9D07330FAE6 for ; Thu, 26 Jun 2003 22:28:16 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 38814-02 for ; Thu, 26 Jun 2003 19:28:05 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 334EC30F17E for ; Thu, 26 Jun 2003 19:28:05 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 1813393; Thu, 26 Jun 2003 14:59:21 -0700 Message-ID: <3EFB727E.50803@joeconway.com> Date: Thu, 26 Jun 2003 15:23:58 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Clay Luther Cc: "Nigel J. Andrews" , pgsql-interfaces@postgresql.org Subject: Re: Dissecting Tuples in C References: <1056665701.22881.41.camel@gkar> In-Reply-To: <1056665701.22881.41.camel@gkar> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/86 X-Sequence-Number: 4297 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: TriggerData *trigdata = (TriggerData *) fcinfo->context; rel = trigdata->tg_relation; tupdesc = rel->rd_att; HTH, Joe