Re: How to access NEW or OLD field given only the field's name? - Mailing list pgsql-general

From François Beausoleil
Subject Re: How to access NEW or OLD field given only the field's name?
Date
Msg-id EFF10A72-25BB-4D91-8ADD-367C66074942@teksol.info
Whole thread Raw
In response to Re: How to access NEW or OLD field given only the field's name?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general

Le 2014-03-19 à 19:48, Adrian Klaver a écrit :

On 03/19/2014 02:01 PM, François Beausoleil wrote:

Some experimenting showed that NEW.* does not work. So plan B:


EXECUTE 'SELECT $1.' || TG_ARGV[0] || INTO total USING NEW;
RAISE EXCEPTION 'Total: %, social_impressions: %', total,

Thank you, Adrian. I've accepted the following answer on StackExchange: http://dba.stackexchange.com/a/61304/3935

It's your solution, but with the extra call to format, preventing SQL injection attacks.

Thanks!
François

Attachment

pgsql-general by date:

Previous
From: basti
Date:
Subject: Backup WAL Replication Server
Next
From: José Pedro Santos
Date:
Subject: Re: Dump Database