pg_dump dumps event triggers and transforms unconditionally

Started by Tom Laneover 10 years ago3 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

I noticed $subject while trying to fix the extension membership problem
Karsten Hilbert complained of last week. I do not think that if I ask
for a dump of a single table, that should include event triggers.

AFAICT event triggers don't belong to any particular schema, so I'd
propose that they be dumped only when include_everything is true,
which is the usual rule for objects that don't belong to any schema.

Transforms have got the same issue, which means that the dump of a
database containing, eg, hstore_plperl is outright broken: it will
dump both the extension *and* a CREATE TRANSFORM command. Again, they
ought to obey the default rules for schema-less objects, which in
this case is "dump if include_everything and not an extension member".

regards, tom lane

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

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#1)
Re: pg_dump dumps event triggers and transforms unconditionally

Tom Lane wrote:

I noticed $subject while trying to fix the extension membership problem
Karsten Hilbert complained of last week. I do not think that if I ask
for a dump of a single table, that should include event triggers.

Ugh, certainly not.

AFAICT event triggers don't belong to any particular schema, so I'd
propose that they be dumped only when include_everything is true,
which is the usual rule for objects that don't belong to any schema.

Transforms have got the same issue, which means that the dump of a
database containing, eg, hstore_plperl is outright broken: it will
dump both the extension *and* a CREATE TRANSFORM command. Again, they
ought to obey the default rules for schema-less objects, which in
this case is "dump if include_everything and not an extension member".

Sounds reasonable. (I assume this last detailed rule is what applies to
both object types. Surely event triggers can be part of an extension
too.)

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: pg_dump dumps event triggers and transforms unconditionally

Alvaro Herrera <alvherre@2ndquadrant.com> writes:

Tom Lane wrote:

AFAICT event triggers don't belong to any particular schema, so I'd
propose that they be dumped only when include_everything is true,
which is the usual rule for objects that don't belong to any schema.

Transforms have got the same issue, which means that the dump of a
database containing, eg, hstore_plperl is outright broken: it will
dump both the extension *and* a CREATE TRANSFORM command. Again, they
ought to obey the default rules for schema-less objects, which in
this case is "dump if include_everything and not an extension member".

Sounds reasonable. (I assume this last detailed rule is what applies to
both object types. Surely event triggers can be part of an extension
too.)

Don't know offhand if they can or not, but the code will do the right
thing if so.

regards, tom lane

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