BUG #15560: psql ought to re-check version when re-establishing connections

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: andres(at)anarazel(dot)de
Subject: BUG #15560: psql ought to re-check version when re-establishing connections
Date: 2018-12-19 05:42:32
Message-ID: 15560-314c36aa4d44057e@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15560
Logged by: Andres Freund
Email address: andres(at)anarazel(dot)de
PostgreSQL version: 11.1
Operating system: Debian/Irrelevant
Description:

Hi,

When psql re-establishes a connection it doesn't check the version of the
server like it does during startup, or when changing the connection with
\c.

Now, it's probably not extremely common that the server version changes
without any of the query parameters changing, but I definitely hit this
during development & testing, when I bring up an older version of PG to
compare behaviour.

postgres[8571][1]=# SELECT version();
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ version

├─────────────────────────────────────────────────────────────────────────────────────────┤
│ PostgreSQL 11.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.2.0-10)
8.2.0, 64-bit │
└─────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)

postgres[8571][1]=# \echo :SERVER_VERSION_NAME
11.1
postgres[8571][1]=# SELECT 1;
FATAL: 57P01: terminating connection due to administrator command
LOCATION: ProcessInterrupts, postgres.c:2957
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
Time: 6.267 ms
postgres[8618][1]=# SELECT version();
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ version

├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ PostgreSQL 9.1.23 on x86_64-unknown-linux-gnu, compiled by gcc-6 (Debian
6.2.0-3) 6.2.0 20160901, 64-bit │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)

Time: 4.189 ms
postgres[8618][1]=# \echo :SERVER_VERSION_NAME
11.1

Regards,

Andres

Browse pgsql-bugs by date

  From Date Subject
Next Message Srimal | PickMe 2018-12-19 06:19:53 Undefined symbol error - psql CLI client
Previous Message Michael Paquier 2018-12-19 04:04:14 Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction