Re: Proper way of iterating over the column names in a trigger function. [ SOLVED]
Re: Proper way of iterating over the column names in a trigger function. [ SOLVED]
От:
"Rajesh Kumar Mallah" <mallah.rajesh@gmail.com>
Дата:
On 12/6/06, Tom Lane wrote:
> "Rajesh Kumar Mallah" writes:
> > what is the proper way for iterating over column names of a table using
> > SPI_* functions.
>
> You need to pay attention to the attisdropped field of the TupleDesc
> entries.
thanks.
did the below (hopefully gotcha free)
for (i = 1; i <= tupdesc->natts ; i++) { if ( tupdesc->attrs[i-1]->attisdropped) continue; col_name = SPI_fname(tupdesc, i); elog (NOTICE , "colname: %s" , col_name); }
Warm Regds
Mallah.
>
> regards, tom lane
>