Re: tg_relation doesn't seem to have the attribute names!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Graeme Hinchliffe <graeme(dot)hinchliffe(at)zeninternet(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tg_relation doesn't seem to have the attribute names!
Date: 2004-09-06 16:25:11
Message-ID: 14727.1094487911@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Graeme Hinchliffe <graeme(dot)hinchliffe(at)zeninternet(dot)co(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-09-06 16:40:41 Re: The usual sequential scan, but with LIMIT !
Previous Message Ian Barwick 2004-09-06 15:51:15 Re: Confused with db client encoding