Re: PLPGSQL - extra column existence in trigger

From: Durumdara <durumdara(at)gmail(dot)com>
To:
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PLPGSQL - extra column existence in trigger
Date: 2022-05-09 11:27:30
Message-ID: CAEcMXhkpvfMGO7biny0M=tRfVheg75uQxeCEQnX1CMfHZC8bpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)g(dot)johnston(at)gmail(dot)com> ezt írta (időpont: 2022.
máj. 7., Szo, 16:41):

> On Saturday, May 7, 2022, Durumdara <durumdara(at)gmail(dot)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.
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-05-09 14:08:27 Re: pg_dump: VACUUM and REINDEXING
Previous Message Alvaro Herrera 2022-05-09 09:05:12 Re: Support logical replication of DDLs