pg_dump not dropping event trigger

Started by Greg Atkinsover 8 years ago5 messagesgeneral
Jump to latest
#1Greg Atkins
void.is.meaning@gmail.com

I have a DB with an event trigger, which I am dumping with

pg_dump -Fc --no-acl --no-owner [db_name] > [dump_file]

In my dump file, I can't find any DROP EVENT TRIGGER statement.

In src/bin/pg_dump/pg_dump.c, dumpEventTrigger() calls ArchiveEntry() with a "" argument for the dropStmt parameter. Is it intended to create an entry with no DROP statement?

To be more precise, my scenario is the following:
* I wish to backup & restore a DB which contains an event trigger
* I can't drop the DB and re-create it before restoring
* I can't have CREATE EVENT TRIGGER throw errors about the trigger already existing

What is the recommended procedure?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Atkins (#1)
Re: pg_dump not dropping event trigger

Greg Atkins <void.is.meaning@gmail.com> writes:

I have a DB with an event trigger, which I am dumping with
pg_dump -Fc --no-acl --no-owner [db_name] > [dump_file]

In my dump file, I can't find any DROP EVENT TRIGGER statement.

Well, you wouldn't, for lack of -c ... but yes, it seems you don't
get a DROP EVENT TRIGGER even with that. Will fix.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Greg Atkins
void.is.meaning@gmail.com
In reply to: Tom Lane (#2)
Re: pg_dump not dropping event trigger

Tom,

would you like a bug report to track this?

On Sat, Jul 22, 2017 at 07:00:03PM -0400, Tom Lane wrote:

Greg Atkins <void.is.meaning@gmail.com> writes:

I have a DB with an event trigger, which I am dumping with
pg_dump -Fc --no-acl --no-owner [db_name] > [dump_file]

In my dump file, I can't find any DROP EVENT TRIGGER statement.

Well, you wouldn't, for lack of -c ... but yes, it seems you don't
get a DROP EVENT TRIGGER even with that. Will fix.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Atkins (#3)
Re: pg_dump not dropping event trigger

Greg Atkins <void.is.meaning@gmail.com> writes:

would you like a bug report to track this?

No, it's already dealt with. In any case, your original email was good
enough --- we track bugs these days more by message-ID than anything else.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#4)
Re: pg_dump not dropping event trigger

On Sun, Jul 23, 2017 at 5:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Greg Atkins <void.is.meaning@gmail.com> writes:

would you like a bug report to track this?

No, it's already dealt with. In any case, your original email was good
enough --- we track bugs these days more by message-ID than anything else.

This has been fixed by the following commit, which will be present in
the next round of minor releases planned for the second week of August
(https://www.postgresql.org/developer/roadmap/):
https://git.postgresql.org/pg/commitdiff/93f039b4944fdf806f029ed46cf192bc9021d8e7
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general