diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-24 23:04:37 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-24 23:05:41 -0400 |
| commit | 84c123be1de8a9955741e20c9f945571e40c545e (patch) | |
| tree | 6ea497e47ec62ef8e1ee83b9acfe1fcd2b2419d6 /src/bin/psql/describe.c | |
| parent | 24b29ca8f9dc4a5e5f873f0fcb56438c526700f6 (diff) | |
| download | postgresql-84c123be1de8a9955741e20c9f945571e40c545e.tar.gz | |
Allow new values to be added to an existing enum type.
After much expenditure of effort, we've got this to the point where the
performance penalty is pretty minimal in typical cases.
Andrew Dunstan, reviewed by Brendan Jurd, Dean Rasheed, and Tom Lane
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", |
