Re: PLPGSQL - extra column existence in trigger

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Durumdara <durumdara(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PLPGSQL - extra column existence in trigger
Date: 2022-05-11 10:29:04
Message-ID: 20220511102903.GA4161@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Masahiko Sawada 2022-05-11 12:55:00 Re: Support logical replication of DDLs
Previous Message Amit Kapila 2022-05-11 09:15:18 Re: Support logical replication of DDLs