Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement - Mailing list pgsql-hackers

From Jim Jones
Subject Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date
Msg-id a44b18bf-c8ea-47d5-b951-857857c67c98@uni-muenster.de
Whole thread Raw
In response to Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement  (jian he <jian.universality@gmail.com>)
Responses Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
List pgsql-hackers
Hi Jian

On 28/10/2025 07:06, jian he wrote:
> SELECT pg_get_trigger_ddl('main_table', 'public.modified_a');
> should error out, I think.
> but V7 will not error out, instead it will ignore text "public" and print out
> DDL for the trigger name as "modified_a" which is not what I expected, so I
> raised the question.
> 
> The error message can be different, but it should error out.

+1

> I am fine with v8.
> ERROR:  trigger name cannot be schema qualified
> 
> I’m fine with changing it to the other error message:
> ERROR:  trigger name \"%s\" for table \"%s\" does not exist

I also think that raising an ERROR is the right approach here. My point
was rather the *extra check* for a schema qualified trigger name.
Letting it fail with the existing error message "trigger name \"%s\" for
table \"%s\" does not exist" down the road should be enough.

Best, Jim



pgsql-hackers by date:

Previous
From: Shinya Kato
Date:
Subject: Re: Add wal_fpi_bytes_[un]compressed to pg_stat_wal
Next
From: Peter Eisentraut
Date:
Subject: Re: SQL:2011 Application Time Update & Delete