PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15560
PG Version11.1
Opened2018-12-19 05:42:32+00
Reported byAndres Freund

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15560
Logged by:          Andres Freund
Email address:      (redacted)
PostgreSQL version: 11.1
Operating system:   Debian/Irrelevant


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

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 
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 




2018-12-19 05:42:32+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15560: psql ought to re-check version when re-establishing connections