Skip to content

Commit 0669785

Browse files
committed
Improve psql \df error handling.
David Fetter
1 parent 301f800 commit 0669785

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bin/psql/describe.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
1010
*
11-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.209 2009/04/21 15:49:06 momjian Exp $
11+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.210 2009/04/21 17:28:01 momjian Exp $
1212
*/
1313
#include "postgres_fe.h"
1414

@@ -206,9 +206,15 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
206206
PGresult *res;
207207
printQueryOpt myopt = pset.popt;
208208

209+
if (strlen(functypes) != strspn(functypes, "antwS+"))
210+
{
211+
fprintf(stderr, _("\\df only takes [antwS+] as options\n"));
212+
return true;
213+
}
214+
209215
if (showWindow && pset.sversion < 80400)
210216
{
211-
fprintf(stderr, _("\\df does not take a \"w\" decorator in %d.%d.\n"),
217+
fprintf(stderr, _("\\df does not take a \"w\" option in %d.%d.\n"),
212218
pset.sversion / 10000, (pset.sversion / 100) % 100);
213219
return true;
214220
}

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