pgsql: Set query ID in parallel workers for vacuum, BRIN and btree

2024-09-29 Thread Michael Paquier
Set query ID in parallel workers for vacuum, BRIN and btree All these code paths use their own entry point when starting parallel workers, but failed to set a query ID, even if they set a text query. Hence, this data would be missed in pg_stat_activity for the worker processes. The main entry poi

pgsql: Add num_done counter to the pg_stat_checkpointer view.

2024-09-29 Thread Fujii Masao
Add num_done counter to the pg_stat_checkpointer view. Checkpoints can be skipped when the server is idle. The existing num_timed and num_requested counters in pg_stat_checkpointer track both completed and skipped checkpoints, but there was no way to count only the completed ones. This commit int

pgsql: Bump catalog version for change in VariableSetStmt

2024-09-29 Thread Michael Paquier
Bump catalog version for change in VariableSetStmt Oversight in dc68515968e8, as this breaks SQL functions with a SET command. Reported-by: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4c7

pgsql: Show values of SET statements as constants in pg_stat_statements

2024-09-29 Thread Michael Paquier
Show values of SET statements as constants in pg_stat_statements This is a continuation of work like 11c34b342bd7, done to reduce the bloat of pg_stat_statements by applying more normalization to query entries. This commit is able to detect and normalize values in VariableSetStmt, resulting in: S

Re: pgsql: Show values of SET statements as constants in pg_stat_statements

2024-09-29 Thread Tom Lane
Michael Paquier writes: > Show values of SET statements as constants in pg_stat_statements Shouldn't this have included a catversion bump? The parsenodes.h change would for example break new-style SQL functions that include a SET command. Probably a narrow use-case, but still.

Re: pgsql: Show values of SET statements as constants in pg_stat_statements

2024-09-29 Thread Michael Paquier
On Mon, Sep 30, 2024 at 01:16:47AM -0400, Tom Lane wrote: > Shouldn't this have included a catversion bump? The parsenodes.h > change would for example break new-style SQL functions that include > a SET command. Probably a narrow use-case, but still. Hmm, yeah. I was wondering if I needed a bum

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_16_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- master Details --- https://git.postgresql.org/pg/commi

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_17_STABLE Details --- https://git.postgresql.org/p

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

pgsql: reindexdb: Skip reindexing temporary tables and indexes.

2024-09-29 Thread Fujii Masao
reindexdb: Skip reindexing temporary tables and indexes. Reindexing temp tables or indexes of other sessions is not allowed. However, reindexdb in parallel mode previously listed them as the objects to process, leading to failures. This commit ensures reindexdb in parallel mode skips temporary ta

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-09-29 Thread Alexander Korotkov
Hi! Thank you for your review. On Fri, Sep 27, 2024 at 7:35 AM Michael Paquier wrote: > > On Fri, Sep 20, 2024 at 03:00:20PM +0300, Alexander Korotkov wrote: > > Please, check the attached patchset for implementation of proposed approach. > > 0001 looks like it requires an indentation in its .h

pgsql: In passwordFromFile, don't leak the open file after stat failure

2024-09-29 Thread Tom Lane
In passwordFromFile, don't leak the open file after stat failures. Oversight in e882bcae0. Per Coverity. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e9339782a631eeef01281bc7e1633dd6b970106e Modified Files -- src/interfaces/libpq/fe-connect.c | 5 ++