pgsql: Fix tablespace handling for partitioned indexes

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix tablespace handling for partitioned indexes
Date: 2018-11-03 16:33:29
Message-ID: E1gIyrZ-0003Tg-JN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix tablespace handling for partitioned indexes

When creating partitioned indexes, the tablespace was not being saved
for the parent index. This meant that subsequently created partitions
would not use the right tablespace for their indexes.

ALTER INDEX SET TABLESPACE and ALTER INDEX ALL IN TABLESPACE raised
errors when tried; fix them too. This requires bespoke code for
ATExecCmd() that applies to the special case when the tablespace move is
just a catalog change.

Discussion: https://postgr.es/m/20181102003138.uxpaca6qfxzskepi@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dfa6081419829ef60d6bc02691616337eeb7f988

Modified Files
--------------
src/backend/catalog/heap.c | 10 +++++-
src/backend/commands/tablecmds.c | 60 +++++++++++++++++++++++++++++--
src/test/regress/input/tablespace.source | 10 ++++++
src/test/regress/output/tablespace.source | 19 +++++++++-
4 files changed, 94 insertions(+), 5 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-11-03 17:56:32 pgsql: Make ts_locale.c's character-type functions cope with UTF-16.
Previous Message Stephen Frost 2018-11-03 16:23:16 pgsql: Remove extra word from create sub docs