Skip to content

Commit eb27374

Browse files
committed
Fix another problem in SQL-MED \d displays: should have a clean failure
report if the command is attempted against an old server.
1 parent 6672daa commit eb27374

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/bin/psql/describe.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
1010
*
11-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.191 2008/12/31 18:07:47 tgl Exp $
11+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.192 2008/12/31 18:33:03 tgl Exp $
1212
*/
1313
#include "postgres_fe.h"
1414

@@ -2797,6 +2797,13 @@ listForeignDataWrappers(const char *pattern, bool verbose)
27972797
PGresult *res;
27982798
printQueryOpt myopt = pset.popt;
27992799

2800+
if (pset.sversion < 80400)
2801+
{
2802+
fprintf(stderr, _("The server (version %d.%d) does not support foreign-data wrappers.\n"),
2803+
pset.sversion / 10000, (pset.sversion / 100) % 100);
2804+
return true;
2805+
}
2806+
28002807
initPQExpBuffer(&buf);
28012808
printfPQExpBuffer(&buf,
28022809
"SELECT fdwname AS \"%s\",\n"
@@ -2849,6 +2856,13 @@ listForeignServers(const char *pattern, bool verbose)
28492856
PGresult *res;
28502857
printQueryOpt myopt = pset.popt;
28512858

2859+
if (pset.sversion < 80400)
2860+
{
2861+
fprintf(stderr, _("The server (version %d.%d) does not support foreign-data servers.\n"),
2862+
pset.sversion / 10000, (pset.sversion / 100) % 100);
2863+
return true;
2864+
}
2865+
28522866
initPQExpBuffer(&buf);
28532867
printfPQExpBuffer(&buf,
28542868
"SELECT s.srvname AS \"%s\",\n"
@@ -2908,6 +2922,13 @@ listUserMappings(const char *pattern, bool verbose)
29082922
PGresult *res;
29092923
printQueryOpt myopt = pset.popt;
29102924

2925+
if (pset.sversion < 80400)
2926+
{
2927+
fprintf(stderr, _("The server (version %d.%d) does not support foreign-data user mappings.\n"),
2928+
pset.sversion / 10000, (pset.sversion / 100) % 100);
2929+
return true;
2930+
}
2931+
29112932
initPQExpBuffer(&buf);
29122933
printfPQExpBuffer(&buf,
29132934
"SELECT um.srvname AS \"%s\",\n"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy