pg_dump not dropping event trigger

From: Greg Atkins <void(dot)is(dot)meaning(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump not dropping event trigger
Date: 2017-07-22 19:11:42
Message-ID: 20170722191142.yi4e7tzcg3iacclg@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-07-22 23:00:03 Re: pg_dump not dropping event trigger
Previous Message Arup Rakshit 2017-07-22 17:44:48 Exclude posts which was from blacklisted users Sql help