diff options
author | Simon Riggs | 2017-11-22 18:17:47 +0000 |
---|---|---|
committer | Simon Riggs | 2017-11-22 18:17:47 +0000 |
commit | 3bae43ca4dc6c3123788044436521f1d33d9f930 (patch) | |
tree | fc4ff430a499639746a1f7c0a6f545f78c530b38 /src | |
parent | 05b6ec39d72f7065bb5ce770319e826f1da92441 (diff) |
Sort default partition to bottom of psql \d+
Minor patch to change sort order only
Author: Ashutosh Bapat
Reviewed-by: Álvaro Herrera, Simon Riggs
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/describe.c | 3 | ||||
-rw-r--r-- | src/test/regress/expected/insert.out | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 44c508971a0..99167104d44 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -2875,7 +2875,8 @@ describeOneTableDetails(const char *schemaname, " c.relkind" " FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i" " WHERE c.oid=i.inhrelid AND i.inhparent = '%s'" - " ORDER BY c.oid::pg_catalog.regclass::pg_catalog.text;", oid); + " ORDER BY pg_catalog.pg_get_expr(c.relpartbound, c.oid) = 'DEFAULT'," + " c.oid::pg_catalog.regclass::pg_catalog.text;", oid); else if (pset.sversion >= 80300) printfPQExpBuffer(&buf, "SELECT c.oid::pg_catalog.regclass" diff --git a/src/test/regress/expected/insert.out b/src/test/regress/expected/insert.out index 1116b3a8d24..7481bebd83f 100644 --- a/src/test/regress/expected/insert.out +++ b/src/test/regress/expected/insert.out @@ -436,11 +436,11 @@ from hash_parted order by part; Partition key: LIST (lower(a)) Partitions: part_aa_bb FOR VALUES IN ('aa', 'bb'), part_cc_dd FOR VALUES IN ('cc', 'dd'), - part_default DEFAULT, PARTITIONED, part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED, part_gg FOR VALUES IN ('gg'), PARTITIONED, part_null FOR VALUES IN (NULL), - part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED + part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED, + part_default DEFAULT, PARTITIONED -- cleanup drop table range_parted, list_parted; |