[PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

Поиск
Список
Период
Сортировка
От Philip Alger
Тема [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Дата
Msg-id CAPXBC8K5awmtMoq66DGHe+nD7hUf6HPRVHLeGNBRpCDpzusOXQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Список pgsql-hackers
Hello, 

I am submitting patch as a part of a larger Retail DDL functions project described by Andrew Dunstan here: https://www.postgresql.org/message-id/945db7c5-be75-45bf-b55b-cb1e56f2e3e9%40dunslane.net

This patch creates a function pg_get_trigger_ddl, designed to retrieve the full DDL statement for a trigger. Users can obtain the DDL by providing the table and trigger names, like the following:

    SELECT pg_get_trigger_ddl('my_table_name', 'my_trigger_name');

While pg_get_triggerdef currently provides a similar SQL statement, it requires the trigger's OID, making it less convenient. This function simplifies this by allowing direct input of the table and trigger names, eliminating the need to find the OID beforehand. I opted not to include the "pretty" formatting capability that pg_get_triggerdef offers.

This patch includes documentation, comments, and regression tests, all of which have run successfully.

--
Best, 
Phil Alger
Вложения

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