Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5cad024

Browse files
committed
psql: Reduce compatibility warning
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.
1 parent ef58b87 commit 5cad024

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,14 +3505,24 @@ PSQL_EDITOR_LINENUMBER_ARG='--line '
35053505
</listitem>
35063506

35073507
<listitem>
3508-
<para><application>psql</application> is only guaranteed to work smoothly
3509-
with servers of the same version. That does not mean other combinations
3510-
will fail outright, but subtle and not-so-subtle problems might come
3511-
up. Backslash commands are particularly likely to fail if the
3512-
server is of a newer version than <application>psql</> itself. However,
3513-
backslash commands of the <literal>\d</> family should work with
3514-
servers of versions back to 7.4, though not necessarily with servers
3515-
newer than <application>psql</> itself.
3508+
<para><application>psql</application> works best with servers of the same
3509+
or an older major version. Backslash commands are particularly likely
3510+
to fail if the server is of a newer version than <application>psql</>
3511+
itself. However, backslash commands of the <literal>\d</> family should
3512+
work with servers of versions back to 7.4, though not necessarily with
3513+
servers newer than <application>psql</> itself. The general
3514+
functionality of running SQL commands and displaying query results
3515+
should also work with servers of a newer major version, but this cannot
3516+
be guaranteed in all cases.
3517+
</para>
3518+
<para>
3519+
If you want to use <application>psql</application> to connect to several
3520+
servers of different major versions, it is recommended that you use the
3521+
newest version of <application>psql</application>. Alternatively, you
3522+
can keep a copy of <application>psql</application> from each major
3523+
version around and be sure to use the version that matches the
3524+
respective server. But in practice, this additional complication should
3525+
not be necessary.
35163526
</para>
35173527
</listitem>
35183528

src/bin/psql/command.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,8 +1694,8 @@ connection_warnings(bool in_startup)
16941694
else if (in_startup)
16951695
printf("%s (%s)\n", pset.progname, PG_VERSION);
16961696

1697-
if (pset.sversion / 100 != client_ver / 100)
1698-
printf(_("WARNING: %s version %d.%d, server version %d.%d.\n"
1697+
if (pset.sversion / 100 > client_ver / 100)
1698+
printf(_("WARNING: %s major version %d.%d, server major version %d.%d.\n"
16991699
" Some psql features might not work.\n"),
17001700
pset.progname, client_ver / 10000, (client_ver / 100) % 100,
17011701
pset.sversion / 10000, (pset.sversion / 100) % 100);

0 commit comments

Comments
 (0)