On 12/6/06, Tom Lane <[EMAIL PROTECTED]> wrote:
"Rajesh Kumar Mallah" <[EMAIL PROTECTED]> 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


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to