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

From Durumdara
Subject Re: PLPGSQL - extra column existence in trigger
Date
Msg-id CAEcMXhkpvfMGO7biny0M=tRfVheg75uQxeCEQnX1CMfHZC8bpA@mail.gmail.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
Dear David!

That was a very good idea! I have integrated it! :-)

Priorly I had another idea: I made a DDL to extend the table with "add column if not exists" elements.
But what you suggested is better. Thank you!

Best wishes
dd

David G. Johnston <david.g.johnston@gmail.com> ezt írta (időpont: 2022. máj. 7., Szo, 16:41):
On Saturday, May 7, 2022, Durumdara <durumdara@gmail.com> wrote:


So is there any syntax to not fall on missing columns?

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.

David J. 

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: pg_dump: VACUUM and REINDEXING
Next
From: Tom Lane
Date:
Subject: Re: pg_dump: VACUUM and REINDEXING