psql: display tablespace for partitioned indexes
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 17 Apr 2019 22:17:43 +0000 (18:17 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 17 Apr 2019 22:17:43 +0000 (18:17 -0400)
Nothing was shown previously.

src/bin/psql/describe.c
src/test/regress/input/tablespace.source
src/test/regress/output/tablespace.source

index 3a04b0673a33b5c9109b8353b7a41f2a598ea978..8a269016333abae54b10cf450de886ae4eaf9867 100644 (file)
@@ -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
index 47ae73af95fbce749b29b41bac8d7f042d1d0cf9..14ce0e7e04ffb88557a411e3b830da0fddbd6afe 100644 (file)
@@ -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;
index 29d6d2232be2e2635864bd88e7750e37329e2cb2..8ebe08b9b28769920056eee8075a40b80cbe2dd9 100644 (file)
@@ -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);