pgsql: Fix incorrect format placeholders

2023-03-29 Thread Peter Eisentraut
Fix incorrect format placeholders Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/261cf8962b8ce92ce62c47148bd72a2c2e3351b0 Modified Files -- src/backend/storage/ipc/standby.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Refactor pgoutput_change().

2023-03-29 Thread Amit Kapila
Refactor pgoutput_change(). Instead of mostly-duplicate code for different operation (insert/update/delete) types, write a common code to compute old/new tuples, and check the row filter. Author: Hou Zhijie Reviewed-by: Peter Smith, Amit Kapila Discussion: https://postgr.es/m/os0pr01mb5716194a47

pgsql: Fix outdated comments regarding TupleTableSlots

2023-03-29 Thread David Rowley
Fix outdated comments regarding TupleTableSlots The tts_flag is named TTS_FLAG_SHOULDFREE, so use that instead of TTS_SHOULDFREE, which is the name of the macro that checks for that flag. Additionally, 4da597edf got rid of the TupleTableSlot.tts_tuple field but forgot to update a comment which re

pgsql: Copy and store addrinfo in libpq-owned private memory

2023-03-29 Thread Daniel Gustafsson
Copy and store addrinfo in libpq-owned private memory This refactors libpq to copy addrinfos returned by getaddrinfo to memory owned by libpq such that future improvements can alter for example the order of entries. As a nice side effect of this refactor the mechanism for iteration over addresses

pgsql: Support connection load balancing in libpq

2023-03-29 Thread Daniel Gustafsson
Support connection load balancing in libpq This adds support for load balancing connections with libpq using a connection parameter: load_balance_hosts=. When setting the param to random, hosts and addresses will be connected to in random order. This then results in load balancing across these add

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Fix dereference of dangling pointer in GiST index buffering buil

2023-03-29 Thread Tom Lane
Fix dereference of dangling pointer in GiST index buffering build. gistBuildCallback tried to fetch the size of an index tuple that might have already been freed by gistProcessEmptyingQueue. While this seems to usually be harmless in production builds, in principle it could result in a SIGSEGV, or

pgsql: Add missing .gitignore entries.

2023-03-29 Thread Tom Lane
Add missing .gitignore entries. Oversight in commit 7081ac46ace8c459966174400b53418683c9fe5c. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3aa961378b4e517908a4400cdc476ca299693de9 Modified Files -- src/interfaces/ecpg/test/sql/.gitignore | 2 ++ 1 fil

pgsql: Remove empty function BufmgrCommit().

2023-03-29 Thread Tom Lane
Remove empty function BufmgrCommit(). This function has been a no-op for over a decade. Even if bufmgr regains a need to be called during commit, it seems unlikely that the most appropriate call points would be precisely here, so it's not doing us much good as a placeholder either. Now, removing

pgsql: SQL/JSON: add standard JSON constructor functions

2023-03-29 Thread Alvaro Herrera
SQL/JSON: add standard JSON constructor functions This commit introduces the SQL/JSON standard-conforming constructors for JSON types: JSON_ARRAY() JSON_ARRAYAGG() JSON_OBJECT() JSON_OBJECTAGG() Most of the functionality was already present in PostgreSQL-specific functions, but these include som

pgsql: Fix some section numbers in information_schema.sql

2023-03-29 Thread Peter Eisentraut
Fix some section numbers in information_schema.sql Some of the section numbers that appeared multiple times were not updated completely by previous changes d61d9aa750 and eb3a1376c9. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/38b7437b9088b4859e4489a1a1a9ab7066f

pgsql: meson: Change default buildtype to debugoptimized

2023-03-29 Thread Peter Eisentraut
meson: Change default buildtype to debugoptimized This matches the Autoconf default (-O2 + debug) better. The previous default setting "release" used -O3, which resulted in different compiler warnings. At least for now, we want to avoid such divergence. Discussion: https://www.postgresql.org/m

pgsql: Move definition of standard collations from initdb to pg_collati

2023-03-29 Thread Peter Eisentraut
Move definition of standard collations from initdb to pg_collation.dat The standard collations "ucs_basic" and "unicode" were defined in initdb, even though pg_collation.dat seems like the correct place for them. It seems this was just forgotten during various reorganizations of initdb and pg_col