From: gomer94@yandex.ru
To: pgsql-bugs@postgresql.org
Cc: gomer94@yandex.ru
Subject: BUG #14815: event trigger in extension
Date: Wed, 13 Sep 2017 07:55:59 +0000
Message-ID: <20170913075559.25630.41587@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14815
Logged by: Galiev Mansur
Email address: gomer94@yandex.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: gomer94@yandex.ru
Subject: Re: BUG #14815: event trigger in extension
In-Reply-To: <20170913075559.25630.41587@wrigleys.postgresql.org>
References: <20170913075559.25630.41587@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox