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

From Philip Alger
Subject Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date
Msg-id CAPXBC8KeUmicR-F9SU90+yNAStKN2J6nUhaxBtQRxRpbLw+eZQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement  (Jim Jones <jim.jones@uni-muenster.de>)
Responses Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
List pgsql-hackers
Hi
 
> 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
 
The extra check is for the user experience because the function accepts `text`. A user could theoretically pass in `public.my_trigger`, `"MySchema".my_trigger`, etc. as a string. This function won't allow it and actually educates the user that it's wrong behavior. In v7, as Jian rightly stated, it would ignore any schema a user put in, which would be wrong to do.
 
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.

 I am not sure what you mean here. Are you suggesting keep the check in v7 with `trigger name \"%s\" for table \"%s\" does not exist"` and remove the extra check in v8?

--
Best, 
Phil Alger

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Question about InvalidatePossiblyObsoleteSlot()
Next
From: Nathan Bossart
Date:
Subject: Re: Feature: psql - display current search_path in prompt