git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 301f800)
Improve psql \df error handling.
2009年4月21日 17:28:01 +0000 (17:28 +0000)
2009年4月21日 17:28:01 +0000 (17:28 +0000)
David Fetter


diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 355a35d92ae5162ec9ca7d8c374158f03d6e4aea..e55e4e1bebdf103348ea25cb2081f5a7fa5eae0b 100644 (file)
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.209 2009年04月21日 15:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.210 2009年04月21日 17:28:01 momjian Exp $
*/
#include "postgres_fe.h"
@@ -206,9 +206,15 @@ describeFunctions(const char *functypes, const char *pattern, bool verbose, bool
PGresult *res;
printQueryOpt myopt = pset.popt;
+ if (strlen(functypes) != strspn(functypes, "antwS+"))
+ {
+ fprintf(stderr, _("\\df only takes [antwS+] as options\n"));
+ return true;
+ }
+
if (showWindow && pset.sversion < 80400)
{
- fprintf(stderr, _("\\df does not take a \"w\" decorator in %d.%d.\n"),
+ fprintf(stderr, _("\\df does not take a \"w\" option in %d.%d.\n"),
pset.sversion / 10000, (pset.sversion / 100) % 100);
return true;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /