Re: Does trigger only accept functions?

Поиск
Список
Период
Сортировка
От Isaac Morland
Тема Re: Does trigger only accept functions?
Дата
Msg-id CAMsGm5dqHQ_Sg5wgYg3mXJfOXPrGTK1s2cmNzEriNuAeQt=6NQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Does trigger only accept functions?  (Ron Johnson <ronljohnsonjr@gmail.com>)
Список pgsql-general
On Tue, 11 Jun 2024 at 18:25, Ron Johnson <ronljohnsonjr@gmail.com> wrote:

Since all the functions are going to be similar, I'd write a shell script to generate all the triggers, one per relevant.  If you're going to record every field, then save effort, and don't bother enumerating them.  You'll need to dig into the PG catalog's guts to list columns in the correct order, but Google and Stack Exchange makes that easy enough.

I'd use a DO block and write a loop in PL/PGSQL. Then everything stays in Postgres and you have all the support of Postgres when writing your SQL-writing code (quote_ident, the reg* types, etc.).

В списке pgsql-general по дате отправления:

Предыдущее
От: Casey & Gina
Дата:
Сообщение: Question about UNIX socket connections and SSL
Следующее
От: Justin
Дата:
Сообщение: Re: Questions on logical replication