pgsql: aio: Fix configuration reload in IO workers.

2025-07-11 Thread Thomas Munro
aio: Fix configuration reload in IO workers. method_worker.c installed SignalHandlerForConfigReload, but it failed to actually process reload requests. That hasn't yet produced any concrete problem reports in terms of GUC changes it should have cared about in v18, but it was inconsistent. It did

pgsql: aio: Fix configuration reload in IO workers.

2025-07-11 Thread Thomas Munro
aio: Fix configuration reload in IO workers. method_worker.c installed SignalHandlerForConfigReload, but it failed to actually process reload requests. That hasn't yet produced any concrete problem reports in terms of GUC changes it should have cared about in v18, but it was inconsistent. It did

pgsql: aio: Regularize IO worker internal naming.

2025-07-11 Thread Thomas Munro
aio: Regularize IO worker internal naming. Adopt PgAioXXX convention for pgaio module type names. Rename a function that didn't use a pgaio_worker_ submodule prefix. Rename the internal submit function's arguments to match the indirectly relevant function pointer declaration and nearby examples.

pgsql: aio: Remove obsolete IO worker ID references.

2025-07-11 Thread Thomas Munro
aio: Remove obsolete IO worker ID references. In an ancient ancestor of this code, the postmaster assigned IDs to IO workers. Now it tracks them in an unordered array and doesn't know their IDs, so it might be confusing to readers that it still referred to their indexes as IDs. No change in beha

pgsql: aio: Remove obsolete IO worker ID references.

2025-07-11 Thread Thomas Munro
aio: Remove obsolete IO worker ID references. In an ancient ancestor of this code, the postmaster assigned IDs to IO workers. Now it tracks them in an unordered array and doesn't know their IDs, so it might be confusing to readers that it still referred to their indexes as IDs. No change in beha

pgsql: aio: Regularize IO worker internal naming.

2025-07-11 Thread Thomas Munro
aio: Regularize IO worker internal naming. Adopt PgAioXXX convention for pgaio module type names. Rename a function that didn't use a pgaio_worker_ submodule prefix. Rename the internal submit function's arguments to match the indirectly relevant function pointer declaration and nearby examples.

pgsql: Fix stale idle flag when IO workers exit.

2025-07-11 Thread Thomas Munro
Fix stale idle flag when IO workers exit. Otherwise we could choose a worker that has exited and crash while trying to wake it up. Back-patch to 18. Reported-by: Tomas Vondra Reported-by: Andres Freund Discussion: https://postgr.es/m/t5aqjhkj6xdkido535pds7fk5z4finoxra4zypefjqnlieevbg%40357aaf

pgsql: Fix stale idle flag when IO workers exit.

2025-07-11 Thread Thomas Munro
Fix stale idle flag when IO workers exit. Otherwise we could choose a worker that has exited and crash while trying to wake it up. Back-patch to 18. Reported-by: Tomas Vondra Reported-by: Andres Freund Discussion: https://postgr.es/m/t5aqjhkj6xdkido535pds7fk5z4finoxra4zypefjqnlieevbg%40357aaf

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: Fix inconsistent quoting of role names in ACLs.

2025-07-11 Thread Tom Lane
Fix inconsistent quoting of role names in ACLs. getid() and putid(), which parse and deparse role names within ACL input/output, applied isalnum() to see if a character within a role name requires quoting. They did this even for non-ASCII characters, which is problematic because the results would

pgsql: oauth: Run Autoconf tests with correct compiler flags

2025-07-11 Thread Jacob Champion
oauth: Run Autoconf tests with correct compiler flags Commit b0635bfda split off the CPPFLAGS/LDFLAGS/LDLIBS for libcurl into their own separate Makefile variables, but I neglected to move the existing AC_CHECKs for Curl into a place where they would make use of those variables. They instead teste

pgsql: oauth: Run Autoconf tests with correct compiler flags

2025-07-11 Thread Jacob Champion
oauth: Run Autoconf tests with correct compiler flags Commit b0635bfda split off the CPPFLAGS/LDFLAGS/LDLIBS for libcurl into their own separate Makefile variables, but I neglected to move the existing AC_CHECKs for Curl into a place where they would make use of those variables. They instead teste

pgsql: Add MODE option to CHECKPOINT command.

2025-07-11 Thread Nathan Bossart
Add MODE option to CHECKPOINT command. This option may be set to FAST (the default) to request the checkpoint be completed as fast as possible, or SPREAD to request the checkpoint be spread over a longer interval (based on the checkpoint-related configuration parameters). Note that the server may

pgsql: Rename CHECKPOINT_IMMEDIATE to CHECKPOINT_FAST.

2025-07-11 Thread Nathan Bossart
Rename CHECKPOINT_IMMEDIATE to CHECKPOINT_FAST. The new name more accurately reflects the effects of this flag on a requested checkpoint. Checkpoint-related log messages (i.e., those controlled by the log_checkpoints configuration parameter) will now say "fast" instead of "immediate", too. Likew

pgsql: Add option list to CHECKPOINT command.

2025-07-11 Thread Nathan Bossart
Add option list to CHECKPOINT command. This commit adds the boilerplate code for supporting a list of options in CHECKPOINT commands. No actual options are supported yet, but follow-up commits will add support for MODE and FLUSH_UNLOGGED. While at it, this commit refactors the code for executing

pgsql: Add FLUSH_UNLOGGED option to CHECKPOINT command.

2025-07-11 Thread Nathan Bossart
Add FLUSH_UNLOGGED option to CHECKPOINT command. This option, which is disabled by default, can be used to request the checkpoint also flush dirty buffers of unlogged relations. As with the MODE option, the server may consolidate the options for concurrently requested checkpoints. For example, i

pgsql: Rename CHECKPOINT_FLUSH_ALL to CHECKPOINT_FLUSH_UNLOGGED.

2025-07-11 Thread Nathan Bossart
Rename CHECKPOINT_FLUSH_ALL to CHECKPOINT_FLUSH_UNLOGGED. The new name more accurately relects the effects of this flag on a requested checkpoint. Checkpoint-related log messages (i.e., those controlled by the log_checkpoints configuration parameter) will now say "flush-unlogged" instead of "flus

pgsql: Force LC_NUMERIC to C while running TAP tests.

2025-07-11 Thread Tom Lane
Force LC_NUMERIC to C while running TAP tests. We already forced LC_MESSAGES to C in order to get consistent message output, but that isn't enough to stabilize messages that include %f or similar formatting. I'm a bit surprised that this hasn't come up before. Perhaps we ought to back-patch this