From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Martín Marqués <martin@2ndquadrant.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions
Date: Thu, 16 Jun 2016 14:55:47 -0400
Message-ID: <20160616185547.GA72247@alvherre.pgsql> (raw)
In-Reply-To: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Martín Marqués wrote:
> -bash-4.3$ pg_dump pruebas | psql -d pruebas_pgq
>
> Now, let's check what we have on this new DB:
>
> pruebas_pgq=# \dt pgq.test_pgq_dumpable
> No se encontraron relaciones coincidentes.
> pruebas_pgq=# \dt pgq.*
> Listado de relaciones
> Esquema | Nombre | Tipo | Dueño
> ---------+----------------+-------+----------
> pgq | consumer | tabla | postgres
> pgq | event_template | tabla | postgres
> pgq | queue | tabla | postgres
> pgq | retry_queue | tabla | postgres
> pgq | subscription | tabla | postgres
> pgq | tick | tabla | postgres
> (6 filas)
To make the problem worse, the pgq.create_queue() function also inserts
rows in the pgq.queue table. The pgq.queue table is marked as a
configuration table, so the rows that reference the pgq.event_1 etc
tables are dumped, but not the tables themselves.
This is pretty messy and I wonder why it hadn't been reported thus far.
I would argue that those secondary tables should be created in a
different schema, but then that schema would probably be created by the
pgq extension script too and would not get dumped either.
So we want the policy to change to "dump the table unless it has a
dependency on an extension" (rather than "inherit dump flag from
containing schema). I wonder what other things this change would break.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, martin@2ndquadrant.com
Subject: Re: pg_dump doesn't dump new objects created in schemas from extensions
In-Reply-To: <20160616185547.GA72247@alvherre.pgsql>
References: <409fe594-f4cc-89f5-c0d2-0a921987a864@2ndquadrant.com> <20160616185547.GA72247@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox