pgsql: Refactor aclcheck functions

2022-11-13 Thread Peter Eisentraut
Refactor aclcheck functions Instead of dozens of mostly-duplicate pg_foo_aclcheck() functions, write one common function object_aclcheck() that can handle almost all of them. We already have all the information we need, such as which system catalog corresponds to which catalog table and which col

pgsql: Make PostgreSQL::Test::Cluster::config_data more flexible

2022-11-13 Thread Andrew Dunstan
Make PostgreSQL::Test::Cluster::config_data more flexible Currently this only allows for one argument, which must be present, and always returns a single string. With this change the following now all work: $all_config = $node->config_data; %config_map = ($node->config_data); $incdir = $nod

pgsql: Make PostgreSQL::Test::Cluster::config_data more flexible

2022-11-13 Thread Andrew Dunstan
Make PostgreSQL::Test::Cluster::config_data more flexible Currently this only allows for one argument, which must be present, and always returns a single string. With this change the following now all work: $all_config = $node->config_data; %config_map = ($node->config_data); $incdir = $nod

pgsql: Use installed postgresql.conf.sample for GUC sanity TAP test

2022-11-13 Thread Andrew Dunstan
Use installed postgresql.conf.sample for GUC sanity TAP test The current code looks for the sample file in the source directory, but it seems better to test against the installed sample file. Backpatch to release 15 where the test was introduced. Discussion: https://postgr.es/m/73eea68e-3b6f-5f

pgsql: Use installed postgresql.conf.sample for GUC sanity TAP test

2022-11-13 Thread Andrew Dunstan
Use installed postgresql.conf.sample for GUC sanity TAP test The current code looks for the sample file in the source directory, but it seems better to test against the installed sample file. Backpatch to release 15 where the test was introduced. Discussion: https://postgr.es/m/73eea68e-3b6f-5f

pgsql: Make Bitmapsets be valid Nodes.

2022-11-13 Thread Tom Lane
Make Bitmapsets be valid Nodes. Add a NodeTag field to struct Bitmapset. This is free because of alignment considerations on 64-bit hardware. While it adds some space on 32-bit machines, we aren't optimizing for that case anymore. The advantage is that data structures such as Lists of Bitmapsets

pgsql: Doc: remove pg_prepared_statements.result_types from v15 docs.

2022-11-13 Thread Tom Lane
Doc: remove pg_prepared_statements.result_types from v15 docs. This column is new in v16, but it was listed in the v15 docs too via a back-patching fumble. Per report from Peter Gigowski; diagnosis by Julien Rouhaud. Discussion: https://postgr.es/m/cam7cj6xy_pamx0kgn6u307ekz+qxdfebh27wp87-_yget

pgsql: libpq: Remove unneeded cast and adjust format placeholder

2022-11-13 Thread Peter Eisentraut
libpq: Remove unneeded cast and adjust format placeholder Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/062e133f6d579f50e6e90642defca725d47add1d Modified Files -- src/interfaces/libpq/fe-secure-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 delet

pgsql: libpq: Add missing newlines to error messages

2022-11-13 Thread Peter Eisentraut
libpq: Add missing newlines to error messages Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/45d5ecab49f6c0df607d3ca2ce1995229f416d1a Modified Files -- src/interfaces/libpq/fe-protocol3.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)

pgsql: Invent open_auth_file() in hba.c to refactor authentication file

2022-11-13 Thread Michael Paquier
Invent open_auth_file() in hba.c to refactor authentication file opening This adds a check on the recursion depth when including authentication configuration files, something that has never been done when processing '@' files for database and user name lists in pg_hba.conf. On HEAD, this was lead

pgsql: Add error context callback when tokenizing authentication files

2022-11-13 Thread Michael Paquier
Add error context callback when tokenizing authentication files The parsing of the authentication files for HBA and ident entries happens in two phases: - Tokenization of the files, creating a list of TokenizedAuthLines. - Validation of the HBA and ident entries, building a set of HbaLines or Iden

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu

pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

2022-11-13 Thread Amit Kapila
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay. During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a cleanup lock on the new bucket page after acquiring an exclusive lock on it and raising a PANIC error on failure. However, it is quite possible that checkpointer can acqu