BUG #14815: event trigger in extension

From: gomer94(at)yandex(dot)ru
To: pgsql-bugs(at)postgresql(dot)org
Cc: gomer94(at)yandex(dot)ru
Subject: BUG #14815: event trigger in extension
Date: 2017-09-13 07:55:59
Message-ID: 20170913075559.25630.41587@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14815
Logged by: Galiev Mansur
Email address: gomer94(at)yandex(dot)ru
PostgreSQL version: 9.6.5
Operating system: Ubuntu 16.04.3 LTS x64
Description:

I want to create extension with sql like:

CREATE OR REPLACE FUNCTION keep_any_ddl_command() RETURNS event_trigger
LANGUAGE plpgsql
AS $$
BEGIN
SELECT classid, objid, objsubid FROM
pg_event_trigger_ddl_commands();

-- some insert code;
END;
$$;

CREATE TABLE ddl_events();

CREATE EVENT TRIGGER keep_all_ddl ON ddl_command_end
EXECUTE PROCEDURE keep_any_ddl_command();

but when i'm use CREATE EXTENSION i have:

ERROR: pg_event_trigger_ddl_commands() can only be called in an event
trigger function
CONTEXT: SQL statement "SELECT classid, objid, objsubid FROM
pg_event_trigger_ddl_commands()"
PL/pgSQL function keep_any_ddl_command() line 3 at SQL statement

if create this objects without extension, all ok

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 德哥 2017-09-13 08:11:49 Re: BUG #14812: URI options cann't set with equal char.
Previous Message pfcovello 2017-09-13 07:48:11 BUG #14814: Documentation errors for OpenBSD