Re: Examing cotets of NEW & OLD in a function programed in perl

2020-03-03 Thread Christophe Pettus
> On Mar 3, 2020, at 13:26, stan wrote: > So, they should just be visible as OLD, and NEW as hasshes? They're documented here: https://www.postgresql.org/docs/current/plperl-triggers.html A global hash variable $_TD is available in the trigger function with all sorts of trigger-rela

Re: Examing cotets of NEW & OLD in a function programed in perl

2020-03-03 Thread stan
On Tue, Mar 03, 2020 at 12:59:00PM -0500, Tom Lane wrote: > stan writes: > > I need to write a generic function to process data before allowing the > > insert or update to continue. > > To do this, I need to be able to examine the NEW, and OLD structures > > without prior knowledge of the structur

Re: Examing cotets of NEW & OLD in a function programed in perl

2020-03-03 Thread Tom Lane
stan writes: > I need to write a generic function to process data before allowing the > insert or update to continue. > To do this, I need to be able to examine the NEW, and OLD structures > without prior knowledge of the structure of the table that fired the > trigger. AFAIR, they're just hashes

Examing cotets of NEW & OLD in a function programed in perl

2020-03-03 Thread stan
I need to write a generic function to process data before allowing the insert or update to continue. To do this, I need to be able to examine the NEW, and OLD structures without prior knowledge of the structure of the table that fired the trigger. Can someone show me an example of how to get thes