pgsql: bufmgr: Turn BUFFER_LOCK_* into an enum

2025-12-03 Thread Andres Freund
bufmgr: Turn BUFFER_LOCK_* into an enum It seems cleaner to use an enum to tie the different values together. It also helps to have a more descriptive type in the argument to various functions. Reviewed-by: Melanie Plageman Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biec

pgsql: Rename BUFFERPIN wait event class to BUFFER

2025-12-03 Thread Andres Freund
Rename BUFFERPIN wait event class to BUFFER In an upcoming patch more wait events will be added to the wait event class (for buffer locking), making the current name too specific. Alternatively we could introduce a dedicated wait event class for those, but it seems somewhat confusing to have a BUF

pgsql: Add pg_atomic_unlocked_write_u64

2025-12-03 Thread Andres Freund
Add pg_atomic_unlocked_write_u64 The 64bit equivalent of pg_atomic_unlocked_write_u32(), to be used in an upcoming patch converting BufferDesc.state into a 64bit atomic. Reviewed-by: Melanie Plageman Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff

pgsql: Make stats_ext test faster under cache-clobbering test condition

2025-12-03 Thread Tom Lane
Make stats_ext test faster under cache-clobbering test conditions. Commit 1eccb9315 added a test case that will cause a large number of evaluations of a plpgsql function. With -DCLOBBER_CACHE_ALWAYS, that takes an unreasonable amount of time (hours) because the function's cache entries are repeat

pgsql: Add test for multixid wraparound

2025-12-03 Thread Heikki Linnakangas
Add test for multixid wraparound Author: Andrey Borodin Discussion: https://www.postgresql.org/message-id/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7b81be9b42678c7ab69c3e8f565172f1d8d9e86f Modified Files -

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Set next multixid's offset when creating a new multixid

2025-12-03 Thread Heikki Linnakangas
Set next multixid's offset when creating a new multixid With this commit, the next multixid's offset will always be set on the offsets page, by the time that a backend might try to read it, so we no longer need the waiting mechanism with the condition variable. In other words, this eliminates "cor

pgsql: Use "foo(void)" for definitions of functions with no parameters.

2025-12-03 Thread Nathan Bossart
Use "foo(void)" for definitions of functions with no parameters. Standard practice in PostgreSQL is to use "foo(void)" instead of "foo()", as the latter looks like an "old-style" function declaration. Similar changes were made in commits cdf4b9aff2, 0e72b9d440, 7069dbcc31, f1283ed6cc, 7b66e2c086,

pgsql: Put back alternative-output expected files

2025-12-03 Thread Álvaro Herrera
Put back alternative-output expected files These were removed in 5dee7a603f66, but that was too optimistic, per buildfarm member prion as reported by Tom Lane. Mea (Álvaro's) culpa. Author: Mihail Nikalayeu Discussion: https://postgr.es/m/[email protected] Branch -- master D

pgsql: doc: Consistently use restartpoint in the documentation

2025-12-03 Thread Daniel Gustafsson
doc: Consistently use restartpoint in the documentation The majority of cases already used "restartpoint" with just a few instances of "restart point". Changing the latter spelling to the former ensures consistency in the user facing documentation. Code comments are not affected by this since it i

pgsql: Fix stray references to SubscriptRef

2025-12-03 Thread Peter Eisentraut
Fix stray references to SubscriptRef This type never existed. SubscriptingRef was meant instead. Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/2eaa45e3-efc5-4d75-b082-f8159f51445f%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/

pgsql: Change Pointer to void *

2025-12-03 Thread Peter Eisentraut
Change Pointer to void * The comment for the Pointer type said 'XXX Pointer arithmetic is done with this, so it can't be void * under "true" ANSI compilers.'. This has been fixed in the previous commit 756a4368932. This now changes the definition of the type from char * to void *, as envisaged b

pgsql: Don't rely on pointer arithmetic with Pointer type

2025-12-03 Thread Peter Eisentraut
Don't rely on pointer arithmetic with Pointer type The comment for the Pointer type says 'XXX Pointer arithmetic is done with this, so it can't be void * under "true" ANSI compilers.'. This fixes that. Change from Pointer to use char * explicitly where pointer arithmetic is needed. This makes t