Re: field incrementing in a PL/pgSQL trigger - Mailing list pgsql-general

From Tom Lane
Subject Re: field incrementing in a PL/pgSQL trigger
Date
Msg-id 28415.1098574978@sss.pgh.pa.us
Whole thread Raw
In response to field incrementing in a PL/pgSQL trigger  ("Tim Vadnais" <tvadnais@earthlink.net>)
List pgsql-general
"Tim Vadnais" <tvadnais@earthlink.net> writes:
> My questions are: Is there a way I can dynamically determine the number of
> fields in the row that is being maintained. (a function much like:
> PQnfields(const PGresult *); )
> Then I need a way to get the name of the field (using a function much like:
> PQfname(const PGresult *, int); )

plpgsql isn't capable of doing dynamic field access.  You could do this
in pltcl, I think, and definitely in C.  There are some related examples
in contrib/spi/.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Comment on timezone and interval types
Next
From: Tom Lane
Date:
Subject: Re: '1 year' = '360 days' ????