Re: PLPGSQL - extra column existence in trigger - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: PLPGSQL - extra column existence in trigger
Date
Msg-id 20220511102903.GA4161@depesz.com
Whole thread Raw
In response to Re: PLPGSQL - extra column existence in trigger  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Sat, May 07, 2022 at 07:41:44AM -0700, David G. Johnston wrote:
> No.  I’d probably approach this by generically converting the NEW record to
> json and working with that.  Non-existent object keys return null when
> accessed.

One note - in my tests working with hstore was significantly faster than
json.

It could have changed since I wrote it, but you might want to check it
out:
https://www.depesz.com/2021/04/21/getting-value-from-dynamic-column-in-pl-pgsql-triggers/

depesz



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Deferred constraint trigger semantics
Next
From: "Zwettler Markus (OIZ)"
Date:
Subject: consistent postgresql snapshot