pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL

2021-08-27 Thread Noah Misch
Fix data loss in wal_level=minimal crash recovery of CREATE TABLESPACE. If the system crashed between CREATE TABLESPACE and the next checkpoint, the result could be some files in the tablespace unexpectedly containing no rows. Affected files would be those for which the system did not write WAL;

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Count SP-GiST index scans in pg_stat statistics.

2021-08-27 Thread Tom Lane
Count SP-GiST index scans in pg_stat statistics. Somehow, spgist overlooked the need to call pgstat_count_index_scan(). Hence, pg_stat_all_indexes.idx_scan and equivalent columns never became nonzero for an SP-GiST index, although the related per-tuple counters worked fine. This fix works a bit d

pgsql: Use maintenance_io_concurrency for ANALYZE prefetch

2021-08-27 Thread Stephen Frost
Use maintenance_io_concurrency for ANALYZE prefetch When prefetching pages for ANALYZE, we should be using maintenance_io_concurrenty (by calling get_tablespace_maintenance_io_concurrency(), not get_tablespace_io_concurrency()). ANALYZE prefetching was introduced in c6fc50c, so back-patch to 14.

pgsql: Use maintenance_io_concurrency for ANALYZE prefetch

2021-08-27 Thread Stephen Frost
Use maintenance_io_concurrency for ANALYZE prefetch When prefetching pages for ANALYZE, we should be using maintenance_io_concurrenty (by calling get_tablespace_maintenance_io_concurrency(), not get_tablespace_io_concurrency()). ANALYZE prefetching was introduced in c6fc50c, so back-patch to 14.

pgsql: docs: Add command tags for SQL commands

2021-08-27 Thread Stephen Frost
docs: Add command tags for SQL commands Commit 6c3ffd6 added a couple new predefined roles but didn't properly wrap the SQL commands mentioned in the description of those roles with command tags, so add them now. Backpatch-through: 14 Reported-by: Michael Banck Discussion: https://postgr.es/m/606

pgsql: docs: Add command tags for SQL commands

2021-08-27 Thread Stephen Frost
docs: Add command tags for SQL commands Commit 6c3ffd6 added a couple new predefined roles but didn't properly wrap the SQL commands mentioned in the description of those roles with command tags, so add them now. Backpatch-through: 14 Reported-by: Michael Banck Discussion: https://postgr.es/m/606

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b96c1a23dc97cb860b1e43

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7c8f2c77108dd569f7fba3

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/05fec0b74facdc7a0f96fd

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/38ed1566ee3417319f39ae

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/53597fd6c3cc2042cad990

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/652804ebde82b6bb04b427

pgsql: docs: clarify bgw_restart_time documentation

2021-08-27 Thread Daniel Gustafsson
docs: clarify bgw_restart_time documentation Author: Dave Cramer Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cadk3hhlzmqaqz2bypdqq9yhgqax36kksq6sdkv0yyzsxw6i...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/10d2695b0cbad0ef64367d9c900ca

pgsql: track_io_timing logging: Don't special case 0 ms.

2021-08-27 Thread Peter Geoghegan
track_io_timing logging: Don't special case 0 ms. Adjust track_io_timing related logging code added by commit 94d13d474d. Make it consistent with other nearby autovacuum and autoanalyze logging code by removing logic that suppressed zero millisecond outputs. log_autovacuum_min_duration log output

pgsql: track_io_timing logging: Don't special case 0 ms.

2021-08-27 Thread Peter Geoghegan
track_io_timing logging: Don't special case 0 ms. Adjust track_io_timing related logging code added by commit 94d13d474d. Make it consistent with other nearby autovacuum and autoanalyze logging code by removing logic that suppressed zero millisecond outputs. log_autovacuum_min_duration log output

pgsql: Reorder log_autovacuum_min_duration log output.

2021-08-27 Thread Peter Geoghegan
Reorder log_autovacuum_min_duration log output. This order seems more natural. It starts with details that are particular to heap and index data structures, and ends with system-level costs incurred during the autovacuum worker's VACUUM/ANALYZE operation. Author: Peter Geoghegan Discussion: ht

pgsql: Reorder log_autovacuum_min_duration log output.

2021-08-27 Thread Peter Geoghegan
Reorder log_autovacuum_min_duration log output. This order seems more natural. It starts with details that are particular to heap and index data structures, and ends with system-level costs incurred during the autovacuum worker's VACUUM/ANALYZE operation. Author: Peter Geoghegan Discussion: ht

pgsql: vacuumlazy.c: Remove unnecessary parentheses.

2021-08-27 Thread Peter Geoghegan
vacuumlazy.c: Remove unnecessary parentheses. This was arguably a minor oversight in commit b4af70cb, which cleaned up the function signatures of functions that modify IndexBulkDeleteResult variables. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/de5dcb0796e281fae

pgsql: Change Texinfo output to UTF-8

2021-08-27 Thread Peter Eisentraut
Change Texinfo output to UTF-8 Since the whole documentation tool chain is now UTF-8 and there is an increasing number of non-ISO-8859-1 characters in the text, keeping the Texinfo output in ISO 8859-1 just creates unnecessary complications. Depending on the platform, there are conversion failure

pgsql: Handle interaction of regexp's makesearch and MATCHALL more hone

2021-08-27 Thread Tom Lane
Handle interaction of regexp's makesearch and MATCHALL more honestly. Second thoughts about commit 824bf7190: we apply makesearch() to an NFA after having determined whether it is a MATCHALL pattern. Prepending ".*" doesn't make it non-MATCHALL, but it does change the maximum possible match length

pgsql: Handle interaction of regexp's makesearch and MATCHALL more hone

2021-08-27 Thread Tom Lane
Handle interaction of regexp's makesearch and MATCHALL more honestly. Second thoughts about commit 824bf7190: we apply makesearch() to an NFA after having determined whether it is a MATCHALL pattern. Prepending ".*" doesn't make it non-MATCHALL, but it does change the maximum possible match length

pgsql: Avoid invoking PQfnumber in loop constructs

2021-08-27 Thread Daniel Gustafsson
Avoid invoking PQfnumber in loop constructs When looping over the resultset from a SQL query, extracting the field number before the loop body to avoid repeated calls to PQfnumber is an established pattern. On very wide tables this can have a performance impact, but it wont be noticeable in the c