diff options
Diffstat (limited to 'src/bin/psql/describe.c')
-rw-r--r-- | src/bin/psql/describe.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 2ff6d7dc997..dcafdd2c1ae 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -139,13 +139,22 @@ describeTablespaces(const char *pattern, bool verbose) initPQExpBuffer(&buf); - printfPQExpBuffer(&buf, - "SELECT spcname AS \"%s\",\n" - " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n" - " spclocation AS \"%s\"", - gettext_noop("Name"), - gettext_noop("Owner"), - gettext_noop("Location")); + if (pset.sversion >= 90200) + printfPQExpBuffer(&buf, + "SELECT spcname AS \"%s\",\n" + " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n" + " pg_catalog.pg_tablespace_location(oid) AS \"%s\"", + gettext_noop("Name"), + gettext_noop("Owner"), + gettext_noop("Location")); + else + printfPQExpBuffer(&buf, + "SELECT spcname AS \"%s\",\n" + " pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n" + " spclocation AS \"%s\"", + gettext_noop("Name"), + gettext_noop("Owner"), + gettext_noop("Location")); if (verbose) { |