Re: DROP and ddl_command_end.

2020-03-12 Thread Robert Haas
On Mon, Mar 9, 2020 at 11:54 PM Kyotaro Horiguchi wrote: > Yes, right and I know. I intended the sample being simple, but sorry > for the bogus example. But the problem is not there. The problem is, > the trigger is called for DROP, the function returns no tuples. I'm > not sure DROP is the only c

Re: DROP and ddl_command_end.

2020-03-09 Thread Kyotaro Horiguchi
Thanks. At Mon, 9 Mar 2020 13:29:47 -0400, Robert Haas wrote in > On Mon, Mar 9, 2020 at 3:54 AM Kyotaro Horiguchi > wrote: > > I may be missing something, andt any opinions, thoughts or suggestions > > are welcome. > > Since it's a set-returning function, I would have expected that > instead

Re: DROP and ddl_command_end.

2020-03-09 Thread Robert Haas
On Mon, Mar 9, 2020 at 3:54 AM Kyotaro Horiguchi wrote: > I may be missing something, andt any opinions, thoughts or suggestions > are welcome. Since it's a set-returning function, I would have expected that instead of trying to assign the result to a variable, you'd loop over it using FOR var IN

DROP and ddl_command_end.

2020-03-09 Thread Kyotaro Horiguchi
Hello. When I created an event trigger for ddl_command_end, I think the only means to identify for what the trigger function is called is pg_event_trigger_ddl_commands() so I wrote as the following function and defined an event trigger for ddl_command_end. CREATE OR REPLACE FUNCTION hoge() RETURN