From: Bruce Momjian Date: Tue, 21 Apr 2009 17:28:01 +0000 (+0000) Subject: Improve psql \df error handling. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=3cf2b94b892bfa9c45479ff3edbe6c382011a0c1;p=users%2Fsimon%2Fpostgres.git Improve psql \df error handling. David Fetter --- diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 6dfa33faf8..07a2be5dc6 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -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; }