psql: Reduce compatibility warning
authorPeter Eisentraut
Sat, 1 Sep 2012 03:28:14 +0000 (23:28 -0400)
committerPeter Eisentraut
Sat, 1 Sep 2012 03:28:14 +0000 (23:28 -0400)
Only warn when connecting to a newer server, since connecting to older
servers works pretty well nowadays.  Also update the documentation a
little about current psql/server compatibility expectations.

doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/command.c

index 4b5e5274e5a33e909875733f795144f8ed13cc82..0675a8e17b1ff6b45aad54ab3f3d855a00f745be 100644 (file)
@@ -3505,14 +3505,24 @@ PSQL_EDITOR_LINENUMBER_ARG='--line '
       
 
       
-      psql is only guaranteed to work smoothly
-       with servers of the same version. That does not mean other combinations
-       will fail outright, but subtle and not-so-subtle problems might come
-       up.  Backslash commands are particularly likely to fail if the
-       server is of a newer version than psql itself.  However,
-       backslash commands of the \d family should work with
-       servers of versions back to 7.4, though not necessarily with servers
-       newer than  psql itself.
+      psql works best with servers of the same
+       or an older major version.  Backslash commands are particularly likely
+       to fail if the server is of a newer version than psql
+       itself.  However, backslash commands of the \d family should
+       work with servers of versions back to 7.4, though not necessarily with
+       servers newer than psql itself.  The general
+       functionality of running SQL commands and displaying query results
+       should also work with servers of a newer major version, but this cannot
+       be guaranteed in all cases.
+      
+      
+       If you want to use psql to connect to several
+       servers of different major versions, it is recommended that you use the
+       newest version of psql.  Alternatively, you
+       can keep a copy of psql from each major
+       version around and be sure to use the version that matches the
+       respective server.  But in practice, this additional complication should
+       not be necessary.
       
       
 
index dc04399d0b6c2f6564a158a9ed9eb1b4d6a387ac..b90d2f12b9b07cf939d0bf27a5553c5b85412614 100644 (file)
@@ -1694,8 +1694,8 @@ connection_warnings(bool in_startup)
        else if (in_startup)
            printf("%s (%s)\n", pset.progname, PG_VERSION);
 
-       if (pset.sversion / 100 != client_ver / 100)
-           printf(_("WARNING: %s version %d.%d, server version %d.%d.\n"
+       if (pset.sversion / 100 > client_ver / 100)
+           printf(_("WARNING: %s major version %d.%d, server major version %d.%d.\n"
                     "         Some psql features might not work.\n"),
                 pset.progname, client_ver / 10000, (client_ver / 100) % 100,
                   pset.sversion / 10000, (pset.sversion / 100) % 100);