Skip to content

Commit b036982

Browse files
committed
psql: display tablespace for partitioned indexes
Nothing was shown previously.
1 parent fb9c475 commit b036982

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/bin/psql/describe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3306,7 +3306,8 @@ add_tablespace_footer(printTableContent *const cont, char relkind,
33063306
if (relkind == RELKIND_RELATION ||
33073307
relkind == RELKIND_MATVIEW ||
33083308
relkind == RELKIND_INDEX ||
3309-
relkind == RELKIND_PARTITIONED_TABLE)
3309+
relkind == RELKIND_PARTITIONED_TABLE ||
3310+
relkind == RELKIND_PARTITIONED_INDEX)
33103311
{
33113312
/*
33123313
* We ignore the database default tablespace so that users not using

src/test/regress/input/tablespace.source

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ CREATE INDEX part_a_idx ON testschema.part (a) TABLESPACE regress_tblspace;
6363
CREATE TABLE testschema.part2 PARTITION OF testschema.part FOR VALUES IN (2);
6464
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
6565
where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx';
66+
\d testschema.part_a_idx
6667

6768
-- check that default_tablespace doesn't affect ALTER TABLE index rebuilds
6869
CREATE TABLE testschema.test_default_tab(id bigint) TABLESPACE regress_tblspace;

src/test/regress/output/tablespace.source

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
9494
part_a_idx | regress_tblspace
9595
(3 rows)
9696

97+
\d testschema.part_a_idx
98+
Partitioned index "testschema.part_a_idx"
99+
Column | Type | Key? | Definition
100+
--------+---------+------+------------
101+
a | integer | yes | a
102+
btree, for table "testschema.part"
103+
Tablespace: "regress_tblspace"
104+
97105
-- check that default_tablespace doesn't affect ALTER TABLE index rebuilds
98106
CREATE TABLE testschema.test_default_tab(id bigint) TABLESPACE regress_tblspace;
99107
INSERT INTO testschema.test_default_tab VALUES (1);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy