From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pg_dump is broken for partition tablespaces
Date: Mon, 22 Apr 2019 15:13:22 -0400
Message-ID: <20190422191322.GA30452@alvherre.pgsql> (raw)
In-Reply-To: <21097.1555957836@sss.pgh.pa.us>
On 2019-Apr-22, Tom Lane wrote:
> Yeah, that's where I'm at as well. Alvaro's proposal could be made
> to work perhaps, but I think it would still end up with some odd
> corner-case behaviors. One example is that "TABLESPACE X" would
> be allowed if the database's default tablespace is Y, but if you
> try to dump and restore into a database whose default is X, it'd be
> rejected (?).
Hmm, I don't think so, because dump uses default_tablespace on a plain
table instead of TABLESPACE clauses, and the table is attached
afterwards.
> The results after ALTER DATABASE ... SET TABLESPACE X
> are unclear too.
Currently we disallow SET TABLESPACE X if you have any table in that
tablespace, and we do that by searching for files. A partitioned table
would not have a file that would cause it to fail, so this is something
to study.
(BTW I think these tablespace behaviors are not tested very much. The
tests we have are intra-database operations only, and there's only a
single non-default tablespace.)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, andres@anarazel.de, robertmhaas@gmail.com, david.rowley@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
Subject: Re: pg_dump is broken for partition tablespaces
In-Reply-To: <20190422191322.GA30452@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