3 ms·
cancel key is arbitrary sized https://www.postgresql.org/docs/current/protocol-message-formats.html https://www.postgresql.org/docs/current/protocol-message-fo
by megous 7mo ago
cancel key is arbitrary sized
https://www.postgresql.org/docs/current/protocol-message-formats.html https://www.postgresql.org/docs/current/protocol-message-for... / BackendKeyData
I'm fairly certain that this cancellation approach has nothing to do with UNIX networking assumptions, and everything to do with the connection/process model of PostgreSQL.
Creating a connection => starting a process and passing the accepted socket to it (so in-band cancel would have to go directy to the backend executing the query) + single-threaded backend process not reading from socket when executing a query, so it would get the cancellation request only after the query finishes (or even after all pipelined queries before it finish, which is even worse).
- conradludgate 7mo agoThis is new in postgres 18/protocol 3.2. libpq still defaults to protocol 3.0 and many client drivers don't have support for protocol 3.2