Re: field incrementing in a PL/pgSQL trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tvadnais(at)earthlink(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: field incrementing in a PL/pgSQL trigger
Date: 2004-10-23 23:42:58
Message-ID: 28415.1098574978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Tim Vadnais" <tvadnais(at)earthlink(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-10-23 23:49:15 Comment on timezone and interval types
Previous Message Bruno Wolff III 2004-10-23 23:27:55 Re: The data directory was initialized by PostgreSQL version 7.3, which is not compatible with this version 7.4.3.