Re: partitioned indexes and tablespaces

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: partitioned indexes and tablespaces
Date: 2018-11-03 20:50:13
Message-ID: 20181103205013.ptilinyb5u36fzmz@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Nov-03, Tom Lane wrote:

> Hmm ... in the April thread, one of the main concerns that prevented hasty
> action was fear of breaking dump/restore behavior. Have you checked that
> with this change, a dump/restore will restore the same state (same
> actual tablespace assignments) that existed in the source DB?

I just did, and it does. The tablespaces are changed with individual
"SET default_tablespace" lines whenever it changes between dumping two
indexes.

> How about if the parent partitioned index's tablespace assignment has
> been changed since a child index was made?

Each index is created independently, with the correct default
tablespace, and then they are all attached together to the parent index
using ALTER INDEX ATTTACH PARTITION. The tablespace assignments are
identical to the source database.

> What happens with the --no-tablespaces option?

No "SET default_tablespace" lines are emitted in this case, so
everything ends up in the default tablespace, as expected.

> I think I'm okay with this change if the answers to all those questions
> are sane, but I didn't see them discussed in this thread.

I think they are.

--
Á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 Andreas 'ads' Scherbaum 2018-11-03 20:56:46 Re: Installation instructions update (pg_ctl)
Previous Message Andreas 'ads' Scherbaum 2018-11-03 20:49:38 Re: INSTALL file