]> granicus.if.org Git - postgresql/commit
Fix tablespace handling for partitioned indexes
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Sat, 3 Nov 2018 16:23:37 +0000 (13:23 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Sat, 3 Nov 2018 16:25:29 +0000 (13:25 -0300)
commit33e6c34c32677a168bee4bc6c335aa8d73211a56
treed9c10c05800aaac9f109269478588681c2c11259
parent0e88ba1fe1e02086e718982a86c94c3c366c9d62
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