Re: BackendKeyData is mandatory?
Tatsuo Ishii <ishii@postgresql.org>
From: Tatsuo Ishii <ishii@postgresql.org>
To: tgl@sss.pgh.pa.us
Cc: pgsql-hackers@postgresql.org
Date: 2025-06-17T12:41:31Z
Lists: pgsql-hackers
>> My question is, BackendKeyData is mandatory or not. Currently >> Pgpool-II raises a fatal error if BackendKeyData is not sent before >> ReadyForQuery arrives. This is because without the message, frontend >> cannot send a CancelRequest message later on, as there's no secret >> key. > > As you say, without BackendKeyData it's impossible to send a query > cancel, so we expect the server will always send that. That's my understanding too. >> I heard that some "PostgreSQL compatible" servers do not send >> BackendKeyData message to frontend. I wonder if this is a protocol >> violation. > > I'd say so. Maybe whoever that is doesn't care to support query > cancel. They're within their rights to do that I guess, but > Pgpool-II does not have to support the case. (A less incompatible > way of not supporting query cancel is to send dummy BackendKeyData > values and then just ignore cancel requests. So I don't see that > you need to do anything towards this goal, if it is a goal and > not merely a broken implementation.) Agreed. -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp
Commits
-
Revert unnecessary check for NULL
- 5a26a3e4eeb2 18.0 landed
- 807ee417e562 19 (unreleased) landed
-
libpq: Be strict about cancel key lengths
- e7ff96853ea7 18.0 landed
- e411a8d25a4b 19 (unreleased) landed
-
libpq: Handle OOM by disconnecting instead of hanging or skipping msgs
- 8aa287c9061b 18.0 landed
- f6f0542266f0 19 (unreleased) landed
-
libpq: Complain about missing BackendKeyData later with PGgetCancel()
- 42b1480eb2c6 18.0 landed
- a4801eb691ed 19 (unreleased) landed