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

Philip Alger <paalger0@gmail.com>

From: Philip Alger <paalger0@gmail.com>
To: Marcos Pegoraro <marcos@f10.com.br>
Cc: Jim Jones <jim.jones@uni-muenster.de>, Andrew Dunstan <andrew@dunslane.net>, Cary Huang <cary.huang@highgo.ca>, jian he <jian.universality@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-10-18T18:22:54Z
Lists: pgsql-hackers
Hi Marcos,


wouldn't it be better to have an option to drop them first or create if not
> exists when available ?
>
> pg_get_trigger_ddl(oid, pretty, drop_first)
>

I’m not sure what you’re saying here. There is no pretty  option for this
one, and the intent is for the user to be able to input a table and trigger
to get the CREATE TRIGGER statement. Not sure how drop_first fits in here;
we’re not dropping or creating triggers.

Best,
Phil Alger