On 04/02/2021 08:54, Michael Paquier wrote:
> On Wed, Feb 03, 2021 at 11:29:37AM -0500, Tom Lane wrote:
>> Then let's kill it dead, server and libpq both.
>
> Yeah.
Ok, here we go.
One interesting thing I noticed while doing this:
Up until now, we always used the old protocol for errors that happened
early in backend startup, before we processed the client's protocol
version and set the FrontendProtocol variable. I'm sure that made sense
when V3 was introduced, but it was a surprise to me, and I didn't find
that documented anywhere. I changed it so that we use V3 errors, if
FrontendProtocol is not yet set.
However, I kept rudimentary support for sending errors in protocol
version 2. This way, if a client tries to connect with an old client, we
still send the "unsupported frontend protocol" error in the old format.
Likewise, I kept the code in libpq to understand v2 ErrorResponse
messages during authentication.
- Heikki