Fix tablespace handling for partitioned indexes
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Sat, 3 Nov 2018 16:23:40 +0000 (13:23 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Sat, 3 Nov 2018 16:25:19 +0000 (13:25 -0300)
commitdfa6081419829ef60d6bc02691616337eeb7f988
tree5acc8ac20081c5d378ee18b6bb0c0bf21bed6a4d
parentceadcbe8ffe50f7fb9e1fa5aed652a33aab908a5
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
src/backend/catalog/heap.c
src/backend/commands/tablecmds.c
src/test/regress/input/tablespace.source
src/test/regress/output/tablespace.source