From: Tom Lane Date: Wed, 31 Dec 2008 18:33:03 +0000 (+0000) Subject: Fix another problem in SQL-MED \d displays: should have a clean failure X-Git-Tag: REL8_4_BETA1~505 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb273743ed741e5c8216dd91955612a94fd7022d;p=postgresql Fix another problem in SQL-MED \d displays: should have a clean failure report if the command is attempted against an old server. --- diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d369fe835f..741b637b44 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -8,7 +8,7 @@ * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.191 2008/12/31 18:07:47 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.192 2008/12/31 18:33:03 tgl Exp $ */ #include "postgres_fe.h" @@ -2797,6 +2797,13 @@ listForeignDataWrappers(const char *pattern, bool verbose) PGresult *res; printQueryOpt myopt = pset.popt; + if (pset.sversion < 80400) + { + fprintf(stderr, _("The server (version %d.%d) does not support foreign-data wrappers.\n"), + pset.sversion / 10000, (pset.sversion / 100) % 100); + return true; + } + initPQExpBuffer(&buf); printfPQExpBuffer(&buf, "SELECT fdwname AS \"%s\",\n" @@ -2849,6 +2856,13 @@ listForeignServers(const char *pattern, bool verbose) PGresult *res; printQueryOpt myopt = pset.popt; + if (pset.sversion < 80400) + { + fprintf(stderr, _("The server (version %d.%d) does not support foreign-data servers.\n"), + pset.sversion / 10000, (pset.sversion / 100) % 100); + return true; + } + initPQExpBuffer(&buf); printfPQExpBuffer(&buf, "SELECT s.srvname AS \"%s\",\n" @@ -2908,6 +2922,13 @@ listUserMappings(const char *pattern, bool verbose) PGresult *res; printQueryOpt myopt = pset.popt; + if (pset.sversion < 80400) + { + fprintf(stderr, _("The server (version %d.%d) does not support foreign-data user mappings.\n"), + pset.sversion / 10000, (pset.sversion / 100) % 100); + return true; + } + initPQExpBuffer(&buf); printfPQExpBuffer(&buf, "SELECT um.srvname AS \"%s\",\n"