Only attempt to show collations on servers >= 9.1.
authorMagnus Hagander <magnus@hagander.net>
Thu, 10 May 2012 07:11:38 +0000 (09:11 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 10 May 2012 07:12:51 +0000 (09:12 +0200)
Show a proper error message instead of a SQL error.

Josh Kupershmidt

src/bin/psql/describe.c

index b2c54b5f929c8c32ed2c8c015cb1981cf5116866..6df42fb957e8faa1713106b4bb964bc22c54cec9 100644 (file)
@@ -2893,6 +2893,13 @@ listCollations(const char *pattern, bool verbose, bool showSystem)
        printQueryOpt myopt = pset.popt;
        static const bool translate_columns[] = {false, false, false, false, false};
 
+       if (pset.sversion < 90100)
+       {
+               fprintf(stderr, _("The server (version %d.%d) does not support collations.\n"),
+                               pset.sversion / 10000, (pset.sversion / 100) % 100);
+               return true;
+       }
+
        initPQExpBuffer(&buf);
 
        printfPQExpBuffer(&buf,