postgresql/doc
Jacob Champion 4966bd3ed9 libpq: Grease the protocol by default
Send PG_PROTOCOL_GREASE and _pq_.test_protocol_negotiation, which were
introduced in commit d8d7c5dc8, by default, and fail the connection if
the server attempts to claim support for them. The hope is to provide
feedback to noncompliant implementations and gain confidence in our
ability to advance the protocol. (See the other commit for details.)

To help end users navigate the situation, a link to our documentation
that explains the behavior is displayed. We append this to the error
message when the NegotiateProtocolVersion response is incorrect, or when
the peer sends an error during startup that appears to be grease-
related.

It's still possible for users to connect to servers that don't support
protocol negotiation, by adding max_protocol_version=3.0 to their
connection strings. Only the default connection behavior is impacted.

This commit is tracked as a PG19 open item and will be reverted before
RC1. (The implementation here doesn't handle negotiation with later
server versions, so it can't be released into the wild as a
five-year-supported feature. But an improved implementation might be
able to do so, in the future...)

Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Co-authored-by: Jacob Champion <jacob.champion@enterprisedb.com>
Discussion: https://postgr.es/m/DDPR5BPWH1RJ.1LWAK6QAURVAY%40jeltef.nl
2026-02-23 10:48:20 -08:00
..
src libpq: Grease the protocol by default 2026-02-23 10:48:20 -08:00
KNOWN_BUGS Remove extra newlines at end and beginning of files, add missing newlines 2010-08-19 05:57:36 +00:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
MISSING_FEATURES Remove extra newlines at end and beginning of files, add missing newlines 2010-08-19 05:57:36 +00:00
TODO Change documentation references to PG website to use https: not http: 2017-05-20 21:50:47 -04:00