Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
| От | Philip Alger | 
|---|---|
| Тема | Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement | 
| Дата | |
| Msg-id | CAPXBC8KeUmicR-F9SU90+yNAStKN2J6nUhaxBtQRxRpbLw+eZQ@mail.gmail.com обсуждение исходный текст  | 
		
| Ответ на | Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement (Jim Jones <jim.jones@uni-muenster.de>) | 
| Ответы | 
                	
            		Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
            		
            		 | 
		
| Список | 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 по дате отправления: