pgsql: extension_control_path

2025-03-18 Thread Peter Eisentraut
extension_control_path The new GUC extension_control_path specifies a path to look for extension control files. The default value is $system, which looks in the compiled-in location, as before. The path search uses the same code and works in the same way as dynamic_library_path. Some use cases

pgsql: Fix compiler warning for commit 434dbf69.

2025-03-18 Thread Thomas Munro
Fix compiler warning for commit 434dbf69. Reported-by: Tom Lane Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0b53c08677a6515786bde9d4471b42ef7289759e Modified Files -- src/interfaces/libpq/fe-auth-oauth-curl.c | 2 +- 1 file changed, 1 insertion(+),

pgsql: Fix copy-paste error related to the autovacuum launcher in pgsta

2025-03-18 Thread Michael Paquier
Fix copy-paste error related to the autovacuum launcher in pgstat_io.c Autovacuum launchers perform no WAL IO reads, but pgstat_tracks_io_op() was tracking them as an allowed combination for the "init" and "normal" contexts. This caused the "read", "read_bytes" and "read_time" attributes of pg_st

pgsql: vacuumdb: Teach vacuum_one_database() to reuse query results.

2025-03-18 Thread Nathan Bossart
vacuumdb: Teach vacuum_one_database() to reuse query results. Presently, each call to vacuum_one_database() queries the catalogs to retrieve the list of tables to process. A follow-up commit will add a "missing stats only" feature to --analyze-in-stages, which requires saving the catalog query re

pgsql: psql: Allow queries terminated by semicolons while in pipeline m

2025-03-18 Thread Michael Paquier
psql: Allow queries terminated by semicolons while in pipeline mode Currently, the only way to pipe queries in an ongoing pipeline (in a \startpipeline block) is to leverage the meta-commands able to create extended queries such as \bind, \parse or \bind_named. While this is good enough for testi

pgsql: oauth: Improve validator docs on interruptibility

2025-03-18 Thread Thomas Munro
oauth: Improve validator docs on interruptibility Andres pointed out that EINTR handling is inadequate for real-world use cases. Direct module writers to our wait APIs instead. Author: Jacob Champion Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmodd

pgsql: oauth: Disallow synchronous DNS in libcurl

2025-03-18 Thread Thomas Munro
oauth: Disallow synchronous DNS in libcurl There is concern that a blocking DNS lookup in libpq could stall a backend process (say, via FDW). Since there's currently no strong evidence that synchronous DNS is a popular option, disallow it entirely rather than warning at configure time. We can revi

pgsql: oauth: Simplify copy of PGoauthBearerRequest

2025-03-18 Thread Thomas Munro
oauth: Simplify copy of PGoauthBearerRequest Follow-up to 03366b61d. Since there are no more const members in the PGoauthBearerRequest struct, the previous memcpy() can be replaced with simple assignment. Author: Jacob Champion Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxq

pgsql: oauth: Fix postcondition for set_timer on macOS

2025-03-18 Thread Thomas Munro
oauth: Fix postcondition for set_timer on macOS On macOS, readding an EVFILT_TIMER to a kqueue does not appear to clear out previously queued timer events, so checks for timer expiration do not work correctly during token retrieval. Switching to IPv4-only communication exposes the problem, because

pgsql: oauth: Use IPv4-only issuer in oauth_validator tests

2025-03-18 Thread Thomas Munro
oauth: Use IPv4-only issuer in oauth_validator tests The test authorization server implemented in oauth_server.py does not listen on IPv6. Most of the time, libcurl happily falls back to IPv4 after failing its initial connection, but on NetBSD, something is consistently showing up on the unreserve

pgsql: Ensure first ModifyTable rel initialized if all are pruned

2025-03-18 Thread Amit Langote
Ensure first ModifyTable rel initialized if all are pruned Commit cbc127917e introduced tracking of unpruned relids to avoid processing pruned relations, and changed ExecInitModifyTable() to initialize only unpruned result relations. As a result, MERGE statements that prune all target partitions c

pgsql: Introduce io_max_combine_limit.

2025-03-18 Thread Thomas Munro
Introduce io_max_combine_limit. The existing io_combine_limit can be changed by users. The new io_max_combine_limit is fixed at server startup time, and functions as a silent clamp on the user setting. That in itself is probably quite useful, but the primary motivation is: aio_init.c allocates

pgsql: Increase io_combine_limit range to 1MB.

2025-03-18 Thread Thomas Munro
Increase io_combine_limit range to 1MB. The default of 128kB is unchanged, but the upper limit is changed from 32 blocks to 128 blocks, unless the operating system's IOV_MAX is too low. Some other RDBMSes seem to cap their multi-block buffer pool I/O around this number, and it seems useful to all

pgsql: Fix assertion failure in parallel vacuum with minimal maintenanc

2025-03-18 Thread Masahiko Sawada
Fix assertion failure in parallel vacuum with minimal maintenance_work_mem setting. bbf668d66fbf lowered the minimum value of maintenance_work_mem to 64kB. However, in parallel vacuum cases, since the initial underlying DSA size is 256kB, it attempts to perform a cycle of index vacuuming and tabl

pgsql: Fix assertion failure in parallel vacuum with minimal maintenanc

2025-03-18 Thread Masahiko Sawada
Fix assertion failure in parallel vacuum with minimal maintenance_work_mem setting. bbf668d66fbf lowered the minimum value of maintenance_work_mem to 64kB. However, in parallel vacuum cases, since the initial underlying DSA size is 256kB, it attempts to perform a cycle of index vacuuming and tabl

Re: pgsql: aio: Add core asynchronous I/O infrastructure

2025-03-18 Thread Tom Lane
Andres Freund writes: > I wonder if we should instead either ask those buildfarm animals to be > disabled or have the warning manually disabled. I don't think it's a good > investment on our part to work towards warning cleanliness on clang 4 and 5, > on distros from 2017 and and 2018 respectively

pgsql: Optimize check for pending backend IO stats

2025-03-18 Thread Michael Paquier
Optimize check for pending backend IO stats This commit changes the backend stats code so as we rely on a single boolean rather than a repeated check based on pg_memory_is_all_zeros() in the code, making it cheaper should PgStat_PendingIO get bigger in size. The frequency of backend stats reports

pgsql: Add commit 796bdda484 to .git-blame-ignore-revs.

2025-03-18 Thread Nathan Bossart
Add commit 796bdda484 to .git-blame-ignore-revs. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7fb418f020815a146c5c9f33e3b344ea9d6df3c7 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: vacuumdb: Add option for analyzing only relations missing stats.

2025-03-18 Thread Nathan Bossart
vacuumdb: Add option for analyzing only relations missing stats. This commit adds a new --missing-stats-only option that can be used with --analyze-only or --analyze-in-stages. When this option is specified, vacuumdb will analyze a relation if it lacks any statistics for a column, expression inde

pgsql: Update guidance for running vacuumdb after pg_upgrade.

2025-03-18 Thread Nathan Bossart
Update guidance for running vacuumdb after pg_upgrade. Now that pg_upgrade can carry over most optimizer statistics, we should recommend using vacuumdb's new --missing-stats-only option to only analyze relations that are missing statistics. Reviewed-by: John Naylor Discussion: https://postgr.es/

Re: pgsql: Increase default maintenance_io_concurrency to 16

2025-03-18 Thread Andres Freund
Hi, On 2025-03-18 16:08:22 -0400, Bruce Momjian wrote: > This commit makes our default random_page_cost = 4 out of line with > these new settings (assumes modern SSD/NAS/SAN hardware) and more out of > line with reality. How so? That seems like an independent consideration to me. Greetings, And

Re: pgsql: Increase default maintenance_io_concurrency to 16

2025-03-18 Thread Bruce Momjian
This commit makes our default random_page_cost = 4 out of line with these new settings (assumes modern SSD/NAS/SAN hardware) and more out of line with reality. --- On Tue, Mar 18, 2025 at 01:08:47PM +, Melanie Plageman

pgsql: Doc: manually break lines in wide UUID examples.

2025-03-18 Thread Tom Lane
Doc: manually break lines in wide UUID examples. Buildfarm member crake has been complaining "WARNING: The contents of fo:inline line 1 exceed the available area in the inline-progression direction by 20500 millipoints. (See position 23808:106)" since ba57dcfdc went in. The other doc-building ani

pgsql: smgr: Make SMgrRelation initialization safer against errors

2025-03-18 Thread Andres Freund
smgr: Make SMgrRelation initialization safer against errors In case the smgr_open callback failed, the ->pincount field would not be initialized and the relation would not be put onto the unpinned_relns list. This buglet was introduced in 21d9c3ee4ef7, in 17. Discussion: https://postgr.es/m/3va

pgsql: smgr: Make SMgrRelation initialization safer against errors

2025-03-18 Thread Andres Freund
smgr: Make SMgrRelation initialization safer against errors In case the smgr_open callback failed, the ->pincount field would not be initialized and the relation would not be put onto the unpinned_relns list. This buglet was introduced in 21d9c3ee4ef7, in 17. Discussion: https://postgr.es/m/3va

pgsql: Introduce squashing of constant lists in query jumbling

2025-03-18 Thread Álvaro Herrera
Introduce squashing of constant lists in query jumbling pg_stat_statements produces multiple entries for queries like SELECT something FROM table WHERE col IN (1, 2, 3, ...) depending on the number of parameters, because every element of ArrayExpr is individually jumbled. Most of the time th

pgsql: aio: Infrastructure for io_method=worker

2025-03-18 Thread Andres Freund
aio: Infrastructure for io_method=worker This commit contains the basic, system-wide, infrastructure for io_method=worker. It does not yet actually execute IO, this commit just provides the infrastructure for running IO workers, kept separate for easier review. The number of IO workers can be adj

pgsql: aio: Add io_method=worker

2025-03-18 Thread Andres Freund
aio: Add io_method=worker The previous commit introduced the infrastructure to start io_workers. This commit actually makes the workers execute IOs. IO workers consume IOs from a shared memory submission queue, run traditional synchronous system calls, and perform the shared completion handling i

pgsql: Fix indentation again.

2025-03-18 Thread Robert Haas
Fix indentation again. Because somehow I manage to keep forgetting this. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/796bdda484c838313959f65e2b700f14ac7c0e66 Modified Files -- src/include/commands/explain.h | 2 +- 1 file changed, 1 insertion(+), 1 d

pgsql: Fix headerscheck warning.

2025-03-18 Thread Jeff Davis
Fix headerscheck warning. Reported-by: Tom Lane Discussion: https://postgr.es/m/93731.1742310...@sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/549ea06e4217aca10d3a73dc09cf5018c51bc23a Modified Files -- src/common/unicode/generate-unicod

Re: pgsql: aio: Add core asynchronous I/O infrastructure

2025-03-18 Thread Tom Lane
Andres Freund writes: > aio: Add core asynchronous I/O infrastructure Some of the buildfarm is mildly unhappy with this. So far I see ayu | 2025-03-18 13:08:04 | aio_callback.c:83:12: warning: comparison of constant 1 with expression of type 'PgAioHandleCallbackID' (aka 'enum PgAioH

pgsql: Silence compiler warning.

2025-03-18 Thread Tom Lane
Silence compiler warning. Assorted buildfarm members are complaining about "'process_list' may be used uninitialized in this function" since f76892c9f, presumably because they don't trust that the switch case labels are exhaustive. We can silence that by initializing the variable to NULL. Should

pgsql: Add X25519 to the default set of curves

2025-03-18 Thread Daniel Gustafsson
Add X25519 to the default set of curves Since many clients default to the X25519 curve in the TLS handshake, the fact that the server by defualt doesn't support it cause an extra roundtrip for each TLS connection. By adding multiple curves, which is supported since 3d1ef3a15c3eb68da, we can reduc

pgsql: Simplify reindexdb coding

2025-03-18 Thread Álvaro Herrera
Simplify reindexdb coding get_parallel_object_list() was trying to serve two masters, and it was doing a bad job at both. In particular, it treated the given user_list as an output argument, but only sometimes. This was confusing, and the two paths through it didn't really have all that much in

pgsql: Increase default maintenance_io_concurrency to 16

2025-03-18 Thread Melanie Plageman
Increase default maintenance_io_concurrency to 16 Since its introduction in fc34b0d9de27a, the default maintenance_io_concurrency has been larger than the default effective_io_concurrency. maintenance_io_concurrency primarily controlled prefetching done on behalf of the whole system, for operation

pgsql: Make it possible for loadable modules to add EXPLAIN options.

2025-03-18 Thread Robert Haas
Make it possible for loadable modules to add EXPLAIN options. Modules can use RegisterExtensionExplainOption to register new EXPLAIN options, and GetExplainExtensionId, GetExplainExtensionState, and SetExplainExtensionState to store related state inside the ExplainState object. Since this substan

pgsql: Allow non-btree unique indexes for matviews

2025-03-18 Thread Peter Eisentraut
Allow non-btree unique indexes for matviews We were rejecting non-btree indexes in some cases owing to the inability to determine the equality operators for other index AMs; that problem no longer exists, because we can look up the equality operator using COMPARE_EQ. Stop rejecting these indexes,

pgsql: Allow non-btree unique indexes for partition keys

2025-03-18 Thread Peter Eisentraut
Allow non-btree unique indexes for partition keys We were rejecting non-btree indexes in some cases owing to the inability to determine the equality operators for other index AMs; that problem no longer exists, because we can look up the equality operator using COMPARE_EQ. The problem of not know

pgsql: Add some opfamily support functions to lsyscache.c

2025-03-18 Thread Peter Eisentraut
Add some opfamily support functions to lsyscache.c Add get_opfamily_method() and get_opfamily_member_for_cmptype() in lsyscache.c. No callers yet, but we'll add some soon. This is part of generalizing some parts of the code away from having btree hardcoded and use CompareType instead. Author: M

pgsql: Fix typo.

2025-03-18 Thread Amit Kapila
Fix typo. Author: vignesh C Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/caldanm1kqj0vffdjrpbfyi9shz6lhfee-ckn+eqsepfkheb...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/122a9af5def2db78f2c2131958eab8873bfee93b Modified Files ---

pgsql: Use correct variable name in publicationcmds.c.

2025-03-18 Thread Amit Kapila
Use correct variable name in publicationcmds.c. subid was used at few places for publicationid in publicationcmds.c/.h. Author: vignesh C Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/caldanm1kqj0vffdjrpbfyi9shz6lhfee-ckn+eqsepfkheb...@mail.gmail.com Branch -- master Detail