pgsql: Fix latch event policy that hid socket events.

2025-01-19 Thread Thomas Munro
Fix latch event policy that hid socket events. If a WaitEventSetWait() caller asks for multiple events, an already set latch would previously prevent other events from being reported at the same time. Now, we'll also poll the kernel for other events that would fit in the caller's output buffer wi

pgsql: Fix latch event policy that hid socket events.

2025-01-19 Thread Thomas Munro
Fix latch event policy that hid socket events. If a WaitEventSetWait() caller asks for multiple events, an already set latch would previously prevent other events from being reported at the same time. Now, we'll also poll the kernel for other events that would fit in the caller's output buffer wi

pgsql: Fix latch event policy that hid socket events.

2025-01-19 Thread Thomas Munro
Fix latch event policy that hid socket events. If a WaitEventSetWait() caller asks for multiple events, an already set latch would previously prevent other events from being reported at the same time. Now, we'll also poll the kernel for other events that would fit in the caller's output buffer wi

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Fix header check for continuation records where standbys could b

2025-01-19 Thread Michael Paquier
Fix header check for continuation records where standbys could be stuck XLogPageRead() checks immediately for an invalid WAL record header on a standby, to be able to handle the case of continuation records that need to be read across two different sources. As written, the check was too generic,

pgsql: Remove PrintBufferDescs() and PrintPinnedBufs().

2025-01-19 Thread Tom Lane
Remove PrintBufferDescs() and PrintPinnedBufs(). These have been #ifdef'd out for a long time, and in fact have been uncompilable since commit 48354581a of 2016-04-10. The fact that nobody noticed for so long demonstrates their lack of usefulness, so let's remove them rather than fix them. Autho

pgsql: Be clearer about when jsonapi's need_escapes is needed

2025-01-19 Thread Andrew Dunstan
Be clearer about when jsonapi's need_escapes is needed Most operations beyond pure json parsing need to set need_escapes to true to get access to field names and string scalars. Document this fact more explicitly. Slightly tweaked patch from: Author: Corey Huinker Discussion: https://postgr.e