Re: pg_dump is broken for partition tablespaces

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump is broken for partition tablespaces
Date: 2019-04-22 19:13:22
Message-ID: 20190422191322.GA30452@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-22 19:16:03 Re: TM format can mix encodings in to_char()
Previous Message Alvaro Herrera 2019-04-22 19:08:13 Re: pg_dump is broken for partition tablespaces