Re: Discussion: psql \et -> edit the trigger function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Discussion: psql \et -> edit the trigger function
Дата
Msg-id 908211.1683740015@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Discussion: psql \et -> edit the trigger function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Discussion: psql \et -> edit the trigger function  (Kirk Wolak <wolakk@gmail.com>)
Список pgsql-hackers
I wrote:
> Hmm, I wonder how useful that's really going to be, considering
> that trigger names aren't unique across tables.  Wouldn't it
> need to be more like "\et table-name trigger-name"?

Different line of thought: \et seems awfully single-purpose.
Perhaps we should think more of "\st table-name trigger-name"
(show trigger), which perhaps could print something along the
lines of

CREATE TRIGGER after_ins_stmt_trig AFTER INSERT ON main_table
FOR EACH STATEMENT EXECUTE FUNCTION trigger_func('after_ins_stmt');

CREATE FUNCTION public.trigger_func()
 RETURNS trigger
... the rest like \sf for the trigger function

If you indeed want to edit the function, it's a quick copy-and-paste
from here.  But if you just want to see the trigger definition,
this is more wieldy than looking at the whole "\d table-name"
output.  Also we have less of an overloading problem with the
command name.

            regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: createuser --memeber and PG 16
Следующее
От: Alvaro Herrera
Дата:
Сообщение: de-catalog one error message