Re: pgsql: Remove redundant pg_set_*_stats() variants.

2025-02-25 Thread Michael Paquier
Hi Jeff, On Wed, Feb 26, 2025 at 12:17:03AM +, Jeff Davis wrote: > Remove redundant pg_set_*_stats() variants. > > After commit f3dae2ae58, the primary purpose of separating the > pg_set_*_stats() from the pg_restore_*_stats() variants was > eliminated. > > Leave pg_restore_relation_stats()

pgsql: Adding new PgStat_WalCounters structure in pgstat.h

2025-02-25 Thread Michael Paquier
Adding new PgStat_WalCounters structure in pgstat.h This new structure contains the counters and the data related to the WAL activity statistics gathered from WalUsage, separated into its own structure so as it can be shared across more than one Stats structure in pg_stat.h. This refactoring will

pgsql: Remove pgstat_flush_wal()

2025-02-25 Thread Michael Paquier
Remove pgstat_flush_wal() All the processes that generate WAL should call pgstat_report_wal() to report all their statistics related to WAL, and this is already what happens in the tree. Keeping pgstat_report_wal() is confusing while the other routine is encouraged. This routine is not required

pgsql: Add two-phase option in pg_createsubscriber.

2025-02-25 Thread Amit Kapila
Add two-phase option in pg_createsubscriber. This patch introduces the '--enable-two-phase' option to the 'pg_createsubscriber' utility, allowing users to enable two-phase commit for all subscriptions during their creation. Note that even without this option users can enable the two_phase option

pgsql: Improve FATAL message for invalid TLI history at recovery

2025-02-25 Thread Michael Paquier
Improve FATAL message for invalid TLI history at recovery The original message did not mention where the checkpoint record LSN was found, a control file or a backup_label file. A couple of LOG messages are generated before this FATAL check is reached, providing more details about the way recovery

pgsql: Avoid unnecessary relation stats query in pg_dump.

2025-02-25 Thread Jeff Davis
Avoid unnecessary relation stats query in pg_dump. The few fields we need can be easily collected in getTables() and getIndexes() and stored in RelStatsInfo. Reviewed-by: Tom Lane Reported-by: Andres Freund Co-authored-by: Corey Huinker Co-authored-by: Jeff Davis Discussion: https://postgr.e

pgsql: pg_dump: prepare attribute stats query.

2025-02-25 Thread Jeff Davis
pg_dump: prepare attribute stats query. Follow precedent in pg_dump for preparing queries to improve performance. Also, simplify the query by removing unnecessary joins. Reviewed-by: Tom Lane Reported-by: Andres Freund Co-authored-by: Corey Huinker Co-authored-by: Jeff Davis Discussion: http

pgsql: Re-add GUC track_wal_io_timing

2025-02-25 Thread Michael Paquier
Re-add GUC track_wal_io_timing This commit is a rework of 2421e9a51d20, about which Andres Freund has raised some concerns as it is valuable to have both track_io_timing and track_wal_io_timing in some cases, as the WAL write and fsync paths can be a major bottleneck for some workloads. Hence, it

pgsql: Remove redundant pg_set_*_stats() variants.

2025-02-25 Thread Jeff Davis
Remove redundant pg_set_*_stats() variants. After commit f3dae2ae58, the primary purpose of separating the pg_set_*_stats() from the pg_restore_*_stats() variants was eliminated. Leave pg_restore_relation_stats() and pg_restore_attribute_stats(), which satisfy both purposes, and remove pg_set_rel

pgsql: Change relpath() et al to return path by value

2025-02-25 Thread Andres Freund
Change relpath() et al to return path by value For AIO, and also some other recent patches, we need the ability to call relpath() in a critical section. Until now that was not feasible, as it allocated memory. The fact that relpath() allocated memory also made it awkward to use in log messages be

pgsql: Change _mdfd_segpath() to return paths by value

2025-02-25 Thread Andres Freund
Change _mdfd_segpath() to return paths by value This basically mirrors the changes done in the predecessor commit. While there isn't currently a need to get these paths in critical sections, it seems a shame to unnecessarily allocate memory in these paths now that relpath() doesn't allocate anymor

pgsql: Remove obsolete Python version check

2025-02-25 Thread Peter Eisentraut
Remove obsolete Python version check The checked version is already the current minimum supported version (3.2). Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitd

pgsql: Doc: Fix pg_copy_logical_replication_slot description.

2025-02-25 Thread Amit Kapila
Doc: Fix pg_copy_logical_replication_slot description. This commit documents that the failover option is not copied when using the pg_copy_logical_replication_slot function. In passing, we modify the comments in the function clarifying the reason for this behavior. Reported-by: Author: Hou Zhij