Re: psql display of foreign keys
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-03-26T01:57:29Z
Lists: pgsql-hackers
Attachments
- fixup.patch (text/x-diff) patch
On 2019-Mar-25, Alvaro Herrera wrote:
> v9 attached; this one's final AFAICT.
Actually, I propose this fixup. It doesn't change the current output,
but of course it affects how this works with my patch in
https://postgr.es/m/20190321215420.GA22766@alvherre.pgsql
The v9 patch does not show anything for the partitions of the referenced
partitioned table; with this one it shows like this
-- verify psql behaves sanely
\d droppk
Partitioned table "regress_fk.droppk"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | not null |
Partition key: RANGE (a)
Indexes:
"droppk_pkey" PRIMARY KEY, btree (a)
Referenced by:
TABLE "dropfk" CONSTRAINT "dropfk_a_fkey" FOREIGN KEY (a) REFERENCES droppk(a)
Number of partitions: 3 (Use \d+ to list them.)
\d droppk21
Table "regress_fk.droppk21"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | not null |
Partition of: droppk2 FOR VALUES FROM (1000) TO (1400)
Indexes:
"droppk21_pkey" PRIMARY KEY, btree (a)
Referenced by:
TABLE "dropfk" CONSTRAINT "dropfk_a_fkey" FOREIGN KEY (a) REFERENCES droppk(a)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Improve psql's \d display of foreign key constraints
- 1af25ca0c2d9 12.0 landed
-
pg_partition_ancestors
- b96f6b19487f 12.0 landed