diff options
Diffstat (limited to 'src/bin/psql/describe.c')
| -rw-r--r-- | src/bin/psql/describe.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 57d74e14d7..b705cb29dd 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -473,17 +473,27 @@ describeTypes(const char *pattern, bool verbose, bool showSystem) gettext_noop("Internal name"), gettext_noop("Size")); if (verbose && pset.sversion >= 80300) + { appendPQExpBuffer(&buf, " pg_catalog.array_to_string(\n" " ARRAY(\n" " SELECT e.enumlabel\n" " FROM pg_catalog.pg_enum e\n" - " WHERE e.enumtypid = t.oid\n" - " ORDER BY e.oid\n" + " WHERE e.enumtypid = t.oid\n"); + + if (pset.sversion >= 90100) + appendPQExpBuffer(&buf, + " ORDER BY e.enumsortorder\n"); + else + appendPQExpBuffer(&buf, + " ORDER BY e.oid\n"); + + appendPQExpBuffer(&buf, " ),\n" " E'\\n'\n" " ) AS \"%s\",\n", gettext_noop("Elements")); + } appendPQExpBuffer(&buf, " pg_catalog.obj_description(t.oid, 'pg_type') as \"%s\"\n", |
