Re: tg_relation doesn't seem to have the attribute names! - Mailing list pgsql-general

From Tom Lane
Subject Re: tg_relation doesn't seem to have the attribute names!
Date
Msg-id 14727.1094487911@sss.pgh.pa.us
Whole thread Raw
In response to tg_relation doesn't seem to have the attribute names!  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
List pgsql-general
Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk> writes:
>     I am using the following line to retrieve the attribute name of the 1st
> column for a table on which a trigger has been fired.

> idfield=SPI_fname(trigdata->tg_relation->rd_att,0);

SPI_fname thinks that column numbers start with 1, not 0.

> This code did work for 7.3.x but isn't for 7.4.3

I rather doubt it, as a quick look at the sources shows that SPI_fname
has always returned null for bogus column number (including 0).

            regards, tom lane

pgsql-general by date:

Previous
From: Ian Barwick
Date:
Subject: Re: Confused with db client encoding
Next
From: "Joshua D. Drake"
Date:
Subject: Re: RAD with postgreSQL