pgsql: meson: Fix missing dependency from install-quiet to sepgsql.sql

2023-11-17 Thread Andres Freund
meson: Fix missing dependency from install-quiet to sepgsql.sql This could lead to an error like ERROR: File 'contrib/sepgsql/sepgsql.sql' could not be found Backpatch: 16-, where meson was added Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/823eb3db1c50a6b8a89e

pgsql: meson: Fix missing dependency from install-quiet to sepgsql.sql

2023-11-17 Thread Andres Freund
meson: Fix missing dependency from install-quiet to sepgsql.sql This could lead to an error like ERROR: File 'contrib/sepgsql/sepgsql.sql' could not be found Backpatch: 16-, where meson was added Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/be08a359db723

pgsql: simplehash: preserve consistency in case of OOM.

2023-11-17 Thread Jeff Davis
simplehash: preserve consistency in case of OOM. Compute size first, then allocate, then update the structure. Previously, an out-of-memory when growing could leave the hashtable in an inconsistent state. Discussion: https://postgr.es/m/20231117201334.eyb542qr5yk4g...@awork3.anarazel.de Reviewe

Re: pgsql: docs: Document --with-selinux/-Dselinux options centrally

2023-11-17 Thread Andres Freund
Hi, On 2023-11-17 13:23:54 -0800, Andres Freund wrote: > On 2023-11-17 15:49:52 -0500, Tom Lane wrote: > > Andres Freund writes: > > > docs: Document --with-selinux/-Dselinux options centrally > > > > This appears to have broken building the INSTALL file: > > > > https://buildfarm.postgresql.or

pgsql: docs: Fix standalone INSTALL, broken in 06c70849fb2

2023-11-17 Thread Andres Freund
docs: Fix standalone INSTALL, broken in 06c70849fb2 We should probably check that INSTALL can be generated in CI. Reported-by: Tom Lane Discussion: https://postgr.es/m/795075.1700254...@sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a268a51de692c462

pgsql: doc: update query section to show LIMIT/OFFSET like SELECT

2023-11-17 Thread Bruce Momjian
doc: update query section to show LIMIT/OFFSET like SELECT The parameter names were slightly better in SELECT, so make them match. Reported-by: Euler Taveira Discussion: https://postgr.es/m/cahe3wgh-eyuablg1vs3qthii1tgws31h-fyegrdda7otous...@mail.gmail.com Backpatch-through: master Branch --

Re: pgsql: docs: Document --with-selinux/-Dselinux options centrally

2023-11-17 Thread Andres Freund
Hi, On 2023-11-17 15:49:52 -0500, Tom Lane wrote: > Andres Freund writes: > > docs: Document --with-selinux/-Dselinux options centrally > > This appears to have broken building the INSTALL file: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&dt=2023-11-17%2020%3A20%3A0

pgsql: Release lock on heap buffer before vacuuming FSM

2023-11-17 Thread Andres Freund
Release lock on heap buffer before vacuuming FSM When there are no indexes on a table, we vacuum each heap block after pruning it and then update the freespace map. Periodically, we also vacuum the freespace map. This was done while unnecessarily holding a lock on the heap page. Release the lock b

Re: pgsql: docs: Document --with-selinux/-Dselinux options centrally

2023-11-17 Thread Tom Lane
Andres Freund writes: > docs: Document --with-selinux/-Dselinux options centrally This appears to have broken building the INSTALL file: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&dt=2023-11-17%2020%3A20%3A03 We have a mechanism for supplying alternate text for INSTALL

pgsql: Extract column statistics from CTE references, if possible.

2023-11-17 Thread Tom Lane
Extract column statistics from CTE references, if possible. examine_simple_variable() left this as an unimplemented case years ago, with the result that plans for queries involving un-flattened CTEs might be much stupider than necessary. It's not hard to extend the existing logic for RTE_SUBQUERY

pgsql: docs: Document --with-selinux/-Dselinux options centrally

2023-11-17 Thread Andres Freund
docs: Document --with-selinux/-Dselinux options centrally Previously --with-selinux was documented only in the in the sepgsql documentation and there was no corresponding documentation for meson. There are further improvements that could be made, but this change seems worthwhile even on its own.

pgsql: meson: Change default of 'selinux' feature option to auto

2023-11-17 Thread Andres Freund
meson: Change default of 'selinux' feature option to auto There is really no reason for selinux to behave differently than other options. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/20231103211601.bgqx3cfq6pz2l...@awork3.anarazel.de Branch -- master Details --- https

pgsql: Allow tests to pass in OpenSSL FIPS mode (rest)

2023-11-17 Thread Peter Eisentraut
Allow tests to pass in OpenSSL FIPS mode (rest) This adds alternative expected files for various tests. In src/test/regress/sql/password.sql, we make a small change to the test so that the CREATE ROLE still succeeds even if the ALTER ROLE that attempts to set a password might fail. That way, the

pgsql: Don't specify number of dimensions in cases where we don't know

2023-11-17 Thread Tom Lane
Don't specify number of dimensions in cases where we don't know it. A few places in array_in() and plperl would report a misleading value (always MAXDIM+1) for the number of dimensions in the input, because we'd error out as soon as that was clearly too large rather than scanning the entire input.

pgsql: Allow tests to pass in OpenSSL FIPS mode (TAP tests)

2023-11-17 Thread Peter Eisentraut
Allow tests to pass in OpenSSL FIPS mode (TAP tests) Some tests using md5 authentication have to be skipped. In other cases, we can rewrite the tests to use a different authentication method. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://www.postgresql.org/message-i

pgsql: pgcrypto: Allow tests to pass in OpenSSL FIPS mode

2023-11-17 Thread Peter Eisentraut
pgcrypto: Allow tests to pass in OpenSSL FIPS mode This adds several alternative expected files for when MD5 and 3DES are not available. This is similar to the alternative expected files for when the legacy provider is disabled. In fact, running the pgcrypto tests in FIPS mode makes use of some

pgsql: Register llvm_shutdown using on_proc_exit, not before_shmem_exit

2023-11-17 Thread Daniel Gustafsson
Register llvm_shutdown using on_proc_exit, not before_shmem_exit. This seems more correct, because other before_shmem_exit calls may expect the infrastructure that is needed to run queries and access the database to be working, and also because this cleanup has nothing to do with shared memory. T

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-11-17 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri

pgsql: Register llvm_shutdown using on_proc_exit, not before_shmem_exit

2023-11-17 Thread Daniel Gustafsson
Register llvm_shutdown using on_proc_exit, not before_shmem_exit. This seems more correct, because other before_shmem_exit calls may expect the infrastructure that is needed to run queries and access the database to be working, and also because this cleanup has nothing to do with shared memory. T

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-11-17 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-11-17 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-11-17 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri

pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-11-17 Thread Daniel Gustafsson
llvmjit: Use explicit LLVMContextRef for inlining When performing inlining LLVM unfortunately "leaks" types (the types survive and are usable, but a new round of inlining will recreate new structurally equivalent types). This accumulation will over time amount to a memory leak which for some queri