Обсуждение: [GENERAL] pg_dump not dropping event trigger

Поиск
Список
Период
Сортировка

[GENERAL] pg_dump not dropping event trigger

От
Greg Atkins
Дата:
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
itintended 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?



Re: [GENERAL] pg_dump not dropping event trigger

От
Tom Lane
Дата:
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


Re: [GENERAL] pg_dump not dropping event trigger

От
Greg Atkins
Дата:
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


Re: [GENERAL] pg_dump not dropping event trigger

От
Tom Lane
Дата:
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


Re: [GENERAL] pg_dump not dropping event trigger

От
Michael Paquier
Дата:
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