Skip to content

Commit 3bae43c

Browse files
Sort default partition to bottom of psql \d+
Minor patch to change sort order only Author: Ashutosh Bapat Reviewed-by: Álvaro Herrera, Simon Riggs
1 parent 05b6ec3 commit 3bae43c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/bin/psql/describe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2875,7 +2875,8 @@ describeOneTableDetails(const char *schemaname,
28752875
" c.relkind"
28762876
" FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i"
28772877
" WHERE c.oid=i.inhrelid AND i.inhparent = '%s'"
2878-
" ORDER BY c.oid::pg_catalog.regclass::pg_catalog.text;", oid);
2878+
" ORDER BY pg_catalog.pg_get_expr(c.relpartbound, c.oid) = 'DEFAULT',"
2879+
" c.oid::pg_catalog.regclass::pg_catalog.text;", oid);
28792880
else if (pset.sversion >= 80300)
28802881
printfPQExpBuffer(&buf,
28812882
"SELECT c.oid::pg_catalog.regclass"

src/test/regress/expected/insert.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,11 @@ from hash_parted order by part;
436436
Partition key: LIST (lower(a))
437437
Partitions: part_aa_bb FOR VALUES IN ('aa', 'bb'),
438438
part_cc_dd FOR VALUES IN ('cc', 'dd'),
439-
part_default DEFAULT, PARTITIONED,
440439
part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED,
441440
part_gg FOR VALUES IN ('gg'), PARTITIONED,
442441
part_null FOR VALUES IN (NULL),
443-
part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED
442+
part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED,
443+
part_default DEFAULT, PARTITIONED
444444

445445
-- cleanup
446446
drop table range_parted, list_parted;

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