Re: PLPGSQL - extra column existence in trigger

Поиск
Список
Период
Сортировка
От Durumdara
Тема Re: PLPGSQL - extra column existence in trigger
Дата
Msg-id CAEcMXhkpvfMGO7biny0M=tRfVheg75uQxeCEQnX1CMfHZC8bpA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PLPGSQL - extra column existence in trigger  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: pg_dump: VACUUM and REINDEXING
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump: VACUUM and REINDEXING