pgsql: pgcrypto: Add support for CFB mode in AES encryption

2025-02-14 Thread Daniel Gustafsson
pgcrypto: Add support for CFB mode in AES encryption Cipher Feedback Mode, CFB, is a self-synchronizing stream cipher which is very similar to CBC performed in reverse. Since OpenSSL supports it, we can easily plug it into the existing cipher selection code without any need for infrastructure chan

Re: pgsql: Use streaming read I/O in VACUUM's third phase

2025-02-14 Thread Melanie Plageman
On Fri, Feb 14, 2025 at 1:31 PM Melanie Plageman wrote: > > On Fri, Feb 14, 2025 at 12:59 PM Melanie Plageman > wrote: > > > > Use streaming read I/O in VACUUM's third phase > > > > Make vacuum's third phase (its second pass over the heap), which reaps > > dead items collected in the first phase

Re: pgsql: Convert heap_vac_scan_next_block() boolean parameters to flags

2025-02-14 Thread Daniel Gustafsson
> On 14 Feb 2025, at 22:41, Melanie Plageman wrote: > > On Fri, Feb 14, 2025 at 3:45 PM Daniel Gustafsson wrote: >> >>> On 14 Feb 2025, at 18:59, Melanie Plageman >>> wrote: >>> >>> Convert heap_vac_scan_next_block() boolean parameters to flags >> >> This seems to have made skink upset with

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Fix PQescapeLiteral()/PQescapeIdentifier() length handling

2025-02-14 Thread Andres Freund
Fix PQescapeLiteral()/PQescapeIdentifier() length handling In 5dc1e42b4fa I fixed bugs in various escape functions, unfortunately as part of that I introduced a new bug in PQescapeLiteral()/PQescapeIdentifier(). The bug is that I made PQescapeInternal() just use strlen(), rather than taking the sp

pgsql: Add delay time to VACUUM/ANALYZE (VERBOSE) and autovacuum logs.

2025-02-14 Thread Nathan Bossart
Add delay time to VACUUM/ANALYZE (VERBOSE) and autovacuum logs. Commit bb8dff9995 added this information to the pg_stat_progress_vacuum and pg_stat_progress_analyze system views. This commit adds the same information to the output of VACUUM and ANALYZE with the VERBOSE option and to the autovacuum

Re: pgsql: Convert heap_vac_scan_next_block() boolean parameters to flags

2025-02-14 Thread Daniel Gustafsson
> On 14 Feb 2025, at 18:59, Melanie Plageman wrote: > > Convert heap_vac_scan_next_block() boolean parameters to flags This seems to have made skink upset with a Valgrind error: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2025-02-14%2020%3A30%3A29 -- Daniel Gustafsson

Re: pgsql: Convert heap_vac_scan_next_block() boolean parameters to flags

2025-02-14 Thread Melanie Plageman
On Fri, Feb 14, 2025 at 3:45 PM Daniel Gustafsson wrote: > > > On 14 Feb 2025, at 18:59, Melanie Plageman > > wrote: > > > > Convert heap_vac_scan_next_block() boolean parameters to flags > > This seems to have made skink upset with a Valgrind error: > > https://buildfarm.postgresql.org/cgi-bin/

pgsql: Fix explicit valgrind interaction in read_stream.c.

2025-02-14 Thread Thomas Munro
Fix explicit valgrind interaction in read_stream.c. By calling wipe_mem() on per-buffer data memory that has been released, we are also telling Valgrind that the memory is "noaccess". We need to set it to "undefined" before giving it to the registered callback to fill in, when a slot is reused.

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Fix assertion on dereferenced object

2025-02-14 Thread Daniel Gustafsson
Fix assertion on dereferenced object Commit 27cc7cd2bc8a accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval Reviewed-b

pgsql: Convert heap_vac_scan_next_block() boolean parameters to flags

2025-02-14 Thread Melanie Plageman
Convert heap_vac_scan_next_block() boolean parameters to flags The read stream API only allows one piece of extra per block state to be passed back to the API user (per_buffer_data). lazy_scan_heap() needs two pieces of per-buffer data: whether or not the block was all-visible in the visibility ma

pgsql: Use streaming read I/O in VACUUM's third phase

2025-02-14 Thread Melanie Plageman
Use streaming read I/O in VACUUM's third phase Make vacuum's third phase (its second pass over the heap), which reaps dead items collected in the first phase and marks them as reusable, use the read stream API. This commit adds a new read stream callback, vacuum_reap_lp_read_stream_next(), that lo

pgsql: Use streaming read I/O in VACUUM's first phase

2025-02-14 Thread Melanie Plageman
Use streaming read I/O in VACUUM's first phase Make vacuum's first phase, which prunes and freezes tuples and records dead TIDs, use the read stream API by by converting heap_vac_scan_next_block() to a read stream callback. Reviewed-by: Masahiko Sawada Reviewed-by: Thomas Munro Discussion: htt

pgsql: Describe special values in GUC descriptions more consistently.

2025-02-14 Thread Nathan Bossart
Describe special values in GUC descriptions more consistently. Many GUCs accept special values like -1 or an empty string to disable the feature, use a system default, etc. While the documentation consistently lists these special values, the GUC descriptions do not. Many such descriptions fail t

Re: pgsql: Use streaming read I/O in VACUUM's third phase

2025-02-14 Thread Melanie Plageman
On Fri, Feb 14, 2025 at 12:59 PM Melanie Plageman wrote: > > Use streaming read I/O in VACUUM's third phase > > Make vacuum's third phase (its second pass over the heap), which reaps > dead items collected in the first phase and marks them as reusable, use > the read stream API. This commit adds a

pgsql: Use PqMsg_Progress macro in HandleParallelMessage().

2025-02-14 Thread Nathan Bossart
Use PqMsg_Progress macro in HandleParallelMessage(). Commit a99cc6c6b4 introduced the PqMsg_Progress macro but missed updating HandleParallelMessage() accordingly. Backpatch-through: 17 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/113fc651397e67c1233b914f

pgsql: Use PqMsg_Progress macro in HandleParallelMessage().

2025-02-14 Thread Nathan Bossart
Use PqMsg_Progress macro in HandleParallelMessage(). Commit a99cc6c6b4 introduced the PqMsg_Progress macro but missed updating HandleParallelMessage() accordingly. Backpatch-through: 17 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/760bf588de91daa5426e3d7aaf77de5