summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2019-04-17 22:17:43 +0000
committerAlvaro Herrera2019-04-17 22:17:43 +0000
commitb036982db786f7ef6c118419e7e832167ad4a6a7 (patch)
tree261c4d5b17c816bb8701dfed57f36796356fa982
parentfb9c475597c245562a28d1e916b575ac4ec5c19f (diff)
psql: display tablespace for partitioned indexes
Nothing was shown previously.
-rw-r--r--src/bin/psql/describe.c3
-rw-r--r--src/test/regress/input/tablespace.source1
-rw-r--r--src/test/regress/output/tablespace.source8
3 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 3a04b0673a..8a26901633 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3306,7 +3306,8 @@ add_tablespace_footer(printTableContent *const cont, char relkind,
if (relkind == RELKIND_RELATION ||
relkind == RELKIND_MATVIEW ||
relkind == RELKIND_INDEX ||
- relkind == RELKIND_PARTITIONED_TABLE)
+ relkind == RELKIND_PARTITIONED_TABLE ||
+ relkind == RELKIND_PARTITIONED_INDEX)
{
/*
* We ignore the database default tablespace so that users not using
diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source
index 47ae73af95..14ce0e7e04 100644
--- a/src/test/regress/input/tablespace.source
+++ b/src/test/regress/input/tablespace.source
@@ -63,6 +63,7 @@ CREATE INDEX part_a_idx ON testschema.part (a) TABLESPACE regress_tblspace;
CREATE TABLE testschema.part2 PARTITION OF testschema.part FOR VALUES IN (2);
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx';
+\d testschema.part_a_idx
-- check that default_tablespace doesn't affect ALTER TABLE index rebuilds
CREATE TABLE testschema.test_default_tab(id bigint) TABLESPACE regress_tblspace;
diff --git a/src/test/regress/output/tablespace.source b/src/test/regress/output/tablespace.source
index 29d6d2232b..8ebe08b9b2 100644
--- a/src/test/regress/output/tablespace.source
+++ b/src/test/regress/output/tablespace.source
@@ -94,6 +94,14 @@ SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
part_a_idx | regress_tblspace
(3 rows)
+\d testschema.part_a_idx
+Partitioned index "testschema.part_a_idx"
+ Column | Type | Key? | Definition
+--------+---------+------+------------
+ a | integer | yes | a
+btree, for table "testschema.part"
+Tablespace: "regress_tblspace"
+
-- check that default_tablespace doesn't affect ALTER TABLE index rebuilds
CREATE TABLE testschema.test_default_tab(id bigint) TABLESPACE regress_tblspace;
INSERT INTO testschema.test_default_tab VALUES (1);