Re: Proper way of iterating over the column names in a trigger function. [ SOLVED]

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah
Тема Re: Proper way of iterating over the column names in a trigger function. [ SOLVED]
Дата
Msg-id a97c77030612060939t6ba0566dkfa27a5539316c313@mail.gmail.com
обсуждение исходный текст
Список pgsql-sql
On 12/6/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Rajesh Kumar Mallah" <mallah.rajesh@gmail.com> 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
>


В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard Ray
Дата:
Сообщение: Query is fast and function is slow
Следующее
От: "Phillip Smith"
Дата:
Сообщение: INSERT DELETE RETURNING