Re: event_trigger, 'DROP SCHEMA'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kaido vaikla <kaido.vaikla@xxxxxxxxx> writes:
> FOR r IN SELECT * FROM pg_event_trigger_dropped_objects()
> LOOP
> execute format ('drop role IF EXISTS r_%I', r.object_name);
> END LOOP;

> kvpg2=# drop schema test;
> ERROR:  null values cannot be formatted as an SQL identifier
> CONTEXT:  PL/pgSQL function trigger_after_drop_schema() line 7 at EXECUTE

> Question, what i do wrong?

Assume that every dropped object has a name, looks like.
You would probably do well to check object_type before
trying to drop the role.

			regards, tom lane





[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux