pg_dump dumps EVENT TRIGGER owned by extension

Started by Moshe Jacobsonover 12 years ago6 messagesgeneral
Jump to latest
#1Moshe Jacobson
moshe@neadwerx.com

PostgreSQL 9.3.2

I created an extension that owns an event trigger.
When I dump the database, it puts the event trigger into the dump output
even though it's owned by the extension.
When I restore the database, the extension creates the event trigger and
the restore causes errors because the event trigger already exists.

Is this a bug?

Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc. <http://www.neadwerx.com&gt;
2323 Cumberland Parkway · Suite 201 · Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Moshe Jacobson (#1)
Re: pg_dump dumps EVENT TRIGGER owned by extension

Moshe Jacobson <moshe@neadwerx.com> writes:

PostgreSQL 9.3.2
I created an extension that owns an event trigger.
When I dump the database, it puts the event trigger into the dump output
even though it's owned by the extension.
When I restore the database, the extension creates the event trigger and
the restore causes errors because the event trigger already exists.

Is this a bug?

Yup.

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Moshe Jacobson (#1)
Re: pg_dump dumps EVENT TRIGGER owned by extension

Moshe Jacobson <moshe@neadwerx.com> writes:

PostgreSQL 9.3.2
I created an extension that owns an event trigger.
When I dump the database, it puts the event trigger into the dump output
even though it's owned by the extension.
When I restore the database, the extension creates the event trigger and
the restore causes errors because the event trigger already exists.

Is this a bug?

Actually, there seem to be two distinct bugs: CREATE EVENT TRIGGER forgets
to mark the event trigger as a member of its extension, and pg_dump
doesn't pay any attention anyway when deciding whether to dump the event
trigger. I've committed fixes for these, but if you have an existing
extension that should have an event trigger as member, you'll need to use
ALTER EXTENSION ADD EVENT TRIGGER to clean up the mess.

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

#4Moshe Jacobson
moshe@neadwerx.com
In reply to: Tom Lane (#3)
Re: pg_dump dumps EVENT TRIGGER owned by extension

On Mon, Dec 30, 2013 at 2:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

there seem to be two distinct bugs: CREATE EVENT TRIGGER forgets
to mark the event trigger as a member of its extension, and pg_dump
doesn't pay any attention anyway when deciding whether to dump the event
trigger. I've committed fixes for these, but if you have an existing
extension that should have an event trigger as member, you'll need to use
ALTER EXTENSION ADD EVENT TRIGGER to clean up the mess.

Thank you, Tom.

Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc. <http://www.neadwerx.com&gt;
2323 Cumberland Parkway · Suite 201 · Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

#5Moshe Jacobson
moshe@neadwerx.com
In reply to: Tom Lane (#3)
Re: pg_dump dumps EVENT TRIGGER owned by extension

On Mon, Dec 30, 2013 at 2:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I've committed fixes for these

Will these fixes appear in 9.3.3?

Thanks.

Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc. <http://www.neadwerx.com&gt;
2323 Cumberland Parkway · Suite 201 · Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

#6Michael Paquier
michael@paquier.xyz
In reply to: Moshe Jacobson (#5)
Re: pg_dump dumps EVENT TRIGGER owned by extension

On Tue, Dec 31, 2013 at 5:33 AM, Moshe Jacobson <moshe@neadwerx.com> wrote:

On Mon, Dec 30, 2013 at 2:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I've committed fixes for these

Will these fixes appear in 9.3.3?

Yes.
--
Michael

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