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 3223.1098983896@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 rows that is being maintained.

I'm starting to think there should be a FAQ entry for this ;-)

plpgsql is essentially incapable of doing anything that involves dynamic
field access, especially if the field types aren't known in advance either.
I believe you can do what you want in pltcl, and you can definitely
write such a trigger in C, but plpgsql is the wrong tool for the job.

If you want to try it in C, there are some relevant examples in
contrib/spi/ in the PG source distribution.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: '1 year' = '360 days' ????
Next
From: "Froggy / Froggy Corp."
Date:
Subject: Re: [pgsql-fr-generale] Problème dethreadPostgresql