pgsql: Fix typo in AutoVacLauncherMain().

2025-08-01 Thread Masahiko Sawada
Fix typo in AutoVacLauncherMain(). Author: Yugo Nagata Discussion: https://postgr.es/m/20250802002027.cd35c481f6c6bae7ca2a3...@sraoss.co.jp Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a2c6c4ed3145a411c2591ebd7ca14f30dd98b896 Modified Files -- src/

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix tab-completion for COPY and \copy options.

2025-07-09 Thread Masahiko Sawada
Fix tab-completion for COPY and \copy options. Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql and added support for completing options within WITH clauses. However, the same COPY options were suggested for both COPY TO and COPY FROM commands, even though some options are only

pgsql: Fix missing FSM vacuum opportunities on tables without indexes.

2025-07-01 Thread Masahiko Sawada
Fix missing FSM vacuum opportunities on tables without indexes. Commit c120550edb86 optimized the vacuuming of relations without indexes (a.k.a. one-pass strategy) by directly marking dead item IDs as LP_UNUSED. However, the periodic FSM vacuum was still checking if dead item IDs had been marked a

pgsql: Fix missing FSM vacuum opportunities on tables without indexes.

2025-07-01 Thread Masahiko Sawada
Fix missing FSM vacuum opportunities on tables without indexes. Commit c120550edb86 optimized the vacuuming of relations without indexes (a.k.a. one-pass strategy) by directly marking dead item IDs as LP_UNUSED. However, the periodic FSM vacuum was still checking if dead item IDs had been marked a

pgsql: Fix missing FSM vacuum opportunities on tables without indexes.

2025-07-01 Thread Masahiko Sawada
Fix missing FSM vacuum opportunities on tables without indexes. Commit c120550edb86 optimized the vacuuming of relations without indexes (a.k.a. one-pass strategy) by directly marking dead item IDs as LP_UNUSED. However, the periodic FSM vacuum was still checking if dead item IDs had been marked a

pgsql: Fix cache-dependent test failures in logical decoding.

2025-06-24 Thread Masahiko Sawada
Fix cache-dependent test failures in logical decoding. The regression test added in commit 1230be12f failed with CLOBBER_CACHE_ALWAYS builds as it depends on cache behavior. This test failure occurred only on v13 because the original data loss problem was fixed differently in v13 compared to v14 a

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Fix re-distributing previously distributed invalidation messages

2025-06-16 Thread Masahiko Sawada
-by: Max Madden Reported-by: Braulio Fdo Gonzalez Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Reviewed-by: Hayato Kuroda Discussion: https://postgr.es/m/680bdaf6-f7d1-4536-b580-05c2760c6...@deepbluecap.com Discussion: https://postgr.es/m/18942-0ab1e5ae15661...@postgresql.org

pgsql: Add tab completion for REJECT_LIMIT option.

2025-06-11 Thread Masahiko Sawada
Add tab completion for REJECT_LIMIT option. This addresses an oversight in commit 4ac2a9bec, which introduced the REJECT_LIMIT option to the COPY command. Author: Atsushi Torikoshi Reviewed-by: Yugo Nagata Discussion: https://postgr.es/m/ac23e824d1d602f113a89c91ee56f...@oss.nttdata.com Branch

pgsql: Fix assertion when decrementing eager scanning success and failu

2025-05-28 Thread Masahiko Sawada
Fix assertion when decrementing eager scanning success and failure counters. Previously, we asserted that the eager scan's success and failure counters were positive before decrementing them. However, this assumption was incorrect, as it's possible that some blocks have already been eagerly scanne

pgsql: doc: Fix a typo in pg_recvlogical documentation.

2025-04-07 Thread Masahiko Sawada
doc: Fix a typo in pg_recvlogical documentation. Oversight in cf2655a9029a. Author: Zhijie Hou Discussion: https://postgr.es/m/os3pr01mb5718dd1466e2b9043448ae5094...@os3pr01mb5718.jpnprd01.prod.outlook.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a13d49014

pgsql: pg_recvlogical: Add --failover option.

2025-04-04 Thread Masahiko Sawada
pg_recvlogical: Add --failover option. This new option instructs pg_recvlogical to create the logical replication slot with the failover option enabled. It can be used in conjunction with the --create-slot option. Author: Hayato Kuroda Reviewed-by: Michael Banck Reviewed-by: Masahiko Sawada

pgsql: Restrict copying of invalidated replication slots.

2025-04-04 Thread Masahiko Sawada
Smith Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Restrict copying of invalidated replication slots.

2025-04-03 Thread Masahiko Sawada
Smith Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Restrict copying of invalidated replication slots.

2025-04-03 Thread Masahiko Sawada
Smith Reviewed-by: Masahiko Sawada Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Fix timestamp overflow in UUIDv7 implementation.

2025-03-28 Thread Masahiko Sawada
Fix timestamp overflow in UUIDv7 implementation. The uuidv7_interval() function previously converted a shifted microsecond-precision timestamp (64-bit integer) to another 64-bit integer representing a timestamp with nanosecond precision. This conversion caused overflow for dates beyond the year 22

pgsql: Add GUC option to control maximum active replication origins.

2025-03-21 Thread Masahiko Sawada
n provides better flexibility for setting up subscribers, as they may not require replication slots (for cascading replication) but always require replication origins. Author: Euler Taveira Reviewed-by: Amit Kapila Reviewed-by: Masahiko Sawada Reviewed-by: Peter Eisentraut Reviewed-by: vignesh C

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

pgsql: Fix the test 005_char_signedness.

2025-03-17 Thread Masahiko Sawada
Fix the test 005_char_signedness. pg_upgrade test 005_char_signedness was leaving files like delete_old_cluster.sh in the source directory for VPATH and meson builds. The fix is to change the directory to tmp_check before running the test. Reported-by: Robert Haas Reviewed-by: Robert Haas Discu

pgsql: pg_rewind: Add dbname to primary_conninfo when using --write-rec

2025-03-12 Thread Masahiko Sawada
pg_rewind: Add dbname to primary_conninfo when using --write-recovery-conf. This commit enhances pg_rewind's --write-recovery-conf option to include the dbname in the generated primary_conninfo value when specified in the --source-server option. With this modification, the rewound server can conne

pgsql: Fix compiler warning in pg_logicalinspect.

2025-03-12 Thread Masahiko Sawada
Fix compiler warning in pg_logicalinspect. Oversight in bd65cb3cd48. Reported-by: David Rowley Reported-by: Nathan Bossart Author: David Rowley Discussion: https://postgr.es/m/CAApHDvqrhFfnetbcwgGkJ=z63T8HfQ_OyP=vx8byixyxfkt...@mail.gmail.com Branch -- master Details --- https://git

Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p

2025-03-12 Thread Masahiko Sawada
On Tue, Mar 11, 2025 at 10:18 PM Tom Lane wrote: > > Masahiko Sawada writes: > > On Tue, Mar 11, 2025 at 7:08 PM David Rowley wrote: > >> This introduces a new compiler warning for compilers that don't know > >> the ereport(ERROR) does not return. > > &g

Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p

2025-03-11 Thread Masahiko Sawada
On Tue, Mar 11, 2025 at 7:08 PM David Rowley wrote: > > On Wed, 12 Mar 2025 at 05:57, Masahiko Sawada wrote: > > contrib/pg_logicalinspect/pg_logicalinspect.c | 55 --- > > This introduces a new compiler warning for compilers that don't know > the erep

pgsql: pg_logicalinspect: Fix possible crash when passing a directory p

2025-03-11 Thread Masahiko Sawada
-by: Robins Tharakan Co-authored-by: Bertrand Drouvot Co-authored-by: Masahiko Sawada Discussion: https://postgr.es/m/18828-0f4701c635064...@postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bd65cb3cd48a7a5ce48b26f8031ad3968efed87e Modified Files

pgsql: pg_logicalinspect: Stabilize isolation tests.

2025-03-11 Thread Masahiko Sawada
modifies the isolation tests to verify that at least one logical snapshot contains the expected number of committed or ongoing catalog-change transactions. Per buildfarm member skink. Reported-by: Andres Freund Author: Bertrand Drouvot Reviewed-by: Amit Kapila Reviewed-by: Masahiko Sawada Discussion

pgsql: pg_upgrade: Check for the expected error message in TAP tests.

2025-03-04 Thread Masahiko Sawada
pg_upgrade: Check for the expected error message in TAP tests. Since pg_upgrade prints its error messages on stdout, we can't use command_fails_like() to check if it fails for the right reason. This commit uses command_checks_all() in pg_upgrade TAP tests to check the exit status and stdout, enabl

pgsql: Refactor Copy{From|To}GetRoutine() to use pass-by-reference argu

2025-03-04 Thread Masahiko Sawada
Zhao Reported-by: Tom Lane (per reports from coverity) Author: Sutou Kouhei Reviewed-by: Junwang Zhao Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/CAEG8a3L6YCpPksTQMzjD_CvwDEhW3D_t=5md9BvvdOs5k+TA=q...@mail.gmail.com Branch -- master Details --- https

pgsql: doc: Convert UUID functions list to table format.

2025-03-03 Thread Masahiko Sawada
doc: Convert UUID functions list to table format. Convert the list of UUID functions into a table for better readability. This commit also adds references to the UUID type section and includes descriptions of different UUID generation algorithm versions. Author: Andy Alsup Reviewed-by: Laurenz A

Re: pgsql: Refactor COPY FROM to use format callback functions.

2025-03-02 Thread Masahiko Sawada
On Fri, Feb 28, 2025 at 12:14 PM Andrew Dunstan wrote: > > > On 2025-02-28 Fr 2:55 PM, Masahiko Sawada wrote: > > On Fri, Feb 28, 2025 at 11:47 AM Andrew Dunstan wrote: > >> > >> On 2025-02-28 Fr 1:31 PM, Masahiko Sawada wrote: > >> > >>

Re: pgsql: Refactor COPY FROM to use format callback functions.

2025-02-28 Thread Masahiko Sawada
On Fri, Feb 28, 2025 at 3:06 PM Andrew Dunstan wrote: > > > On 2025-02-28 Fr 5:39 PM, Masahiko Sawada wrote: > > On Fri, Feb 28, 2025 at 2:16 PM Sutou Kouhei wrote: > > Hi, > > Thanks for following up the patch! > > In > "Re: pgsql: Refactor COPY FROM

pgsql: Re-export NextCopyFromRawFields() to copy.h.

2025-02-28 Thread Masahiko Sawada
Re-export NextCopyFromRawFields() to copy.h. Commit 7717f630069 removed NextCopyFromRawFields() from copy.h. While it was hoped that NextCopyFrom() could serve as an alternative, certain use cases still require NextCopyFromRawFields(). For instance, extensions like file_text_array_fdw, which proce

Re: pgsql: Refactor COPY FROM to use format callback functions.

2025-02-28 Thread Masahiko Sawada
On Fri, Feb 28, 2025 at 2:16 PM Sutou Kouhei wrote: > > Hi, > > Thanks for following up the patch! > > In > "Re: pgsql: Refactor COPY FROM to use format callback functions." on Fri, > 28 Feb 2025 12:56:19 -0800, > Masahiko Sawada wrote: > > >

Re: pgsql: Refactor COPY FROM to use format callback functions.

2025-02-28 Thread Masahiko Sawada
On Fri, Feb 28, 2025 at 11:47 AM Andrew Dunstan wrote: > > > On 2025-02-28 Fr 1:31 PM, Masahiko Sawada wrote: > > Refactor COPY FROM to use format callback functions. > > This commit introduces a new CopyFromRoutine struct, which is a set of > callback routines to read tup

pgsql: Refactor COPY FROM to use format callback functions.

2025-02-28 Thread Masahiko Sawada
sentations in text or CSV mode. The performance benchmark results showed ~5% performance gain in text or CSV mode. Author: Sutou Kouhei Reviewed-by: Masahiko Sawada Reviewed-by: Michael Paquier Reviewed-by: Andres Freund Reviewed-by: Tomas Vondra Reviewed-by: Junwang Zhao Discussion: https://p

pgsql: Refactor COPY TO to use format callback functions.

2025-02-27 Thread Masahiko Sawada
mode. The performance benchmark results showed ~5% performance gain in text or CSV mode. Author: Sutou Kouhei Reviewed-by: Masahiko Sawada Reviewed-by: Michael Paquier Reviewed-by: Andres Freund Reviewed-by: Tomas Vondra Reviewed-by: Junwang Zhao Discussion: https://p

pgsql: Fix a typo in 005_char_signedness.pl test.

2025-02-26 Thread Masahiko Sawada
Fix a typo in 005_char_signedness.pl test. The test in 005_char_signedness.pl was missing a dash in the --set-char-signedness option. Although the test didn't fail since it doesn't check the error message, it resulted in an unexpected error message instead of the intended one. Oversight in 1aab68

pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr

2025-02-24 Thread Masahiko Sawada
Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary. When a standby replays an XLOG_PARAMETER_CHANGE record that lowers wal_level below logical, we invalidate all logical slots in hot standby mode. However, if this record was replayed while not in hot standby mode, logical slots

pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr

2025-02-24 Thread Masahiko Sawada
Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary. When a standby replays an XLOG_PARAMETER_CHANGE record that lowers wal_level below logical, we invalidate all logical slots in hot standby mode. However, if this record was replayed while not in hot standby mode, logical slots

pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr

2025-02-24 Thread Masahiko Sawada
Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary. When a standby replays an XLOG_PARAMETER_CHANGE record that lowers wal_level below logical, we invalidate all logical slots in hot standby mode. However, if this record was replayed while not in hot standby mode, logical slots

pgsql: pg_resetwal: Add --char-signedness option to change the default

2025-02-21 Thread Masahiko Sawada
pg_resetwal: Add --char-signedness option to change the default char signedness. With the newly added option --char-signedness, pg_resetwal updates the default char signedness flag in the controlfile. This option is primarily intended for an upcoming patch that pg_upgrade supports preserving the d

pgsql: Add test 005_char_signedness.pl to meson.build.

2025-02-21 Thread Masahiko Sawada
Add test 005_char_signedness.pl to meson.build. Oversight in a8238f87f98 where the test has been added. Discussion: https://postgr.es/m/CB11ADBC-0C3F-4FE0-A678-666EE80CBB07%40amazon.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/78d3f48895029e2c7c579fc38c07f2

pgsql: Fix an issue with index scan using pg_trgm due to char signednes

2025-02-21 Thread Masahiko Sawada
Fix an issue with index scan using pg_trgm due to char signedness on different architectures. GIN and GiST indexes utilizing pg_trgm's opclasses store sorted trigrams within index tuples. When comparing and sorting each trigram, pg_trgm treats each character as a 'char[3]' type in C. However, the

pgsql: pg_upgrade: Add --set-char-signedness to set the default char si

2025-02-21 Thread Masahiko Sawada
pg_upgrade: Add --set-char-signedness to set the default char signedness of new cluster. This change adds a new option --set-char-signedness to pg_upgrade. It enables user to set arbitrary signedness during pg_upgrade. This helps cases where user who knew they copied the v17 source cluster from x

pgsql: Add default_char_signedness field to ControlFileData.

2025-02-21 Thread Masahiko Sawada
Add default_char_signedness field to ControlFileData. The signedness of the 'char' type in C is implementation-dependent. For instance, 'signed char' is used by default on x86 CPUs, while 'unsigned char' is used on aarch CPUs. Previously, we accidentally let C implementation signedness affect pers

pgsql: pg_upgrade: Preserve default char signedness value from old clus

2025-02-21 Thread Masahiko Sawada
pg_upgrade: Preserve default char signedness value from old cluster. Commit 44fe30fdab6 introduced the 'default_char_signedness' field in controlfile. Newly created database clusters always set this field to 'signed'. This change ensures that pg_upgrade updates the 'default_char_signedness' to 'u

pgsql: Rename RBTXN_PREPARE to RBTXN_IS_PREPARE for better clarificatio

2025-02-12 Thread Masahiko Sawada
Rename RBTXN_PREPARE to RBTXN_IS_PREPARE for better clarification. RBTXN_PREPARE flag and rbtxn_prepared macro could be misinterpreted as either indicating the transaction type (e.g. a prepared transaction or a normal transaction) or its currentstate (e.g. skipped or its prepare message is sent),

pgsql: Skip logical decoding of already-aborted transactions.

2025-02-12 Thread Masahiko Sawada
Skip logical decoding of already-aborted transactions. Previously, transaction aborts were detected concurrently only during system catalog scans while replaying a transaction in streaming mode. This commit adds an additional CLOG lookup to check the transaction status, allowing the logical decod

pgsql: radixtree: Fix crash when non-creator begins iteration over shar

2025-02-06 Thread Masahiko Sawada
radixtree: Fix crash when non-creator begins iteration over shared tree. Previously, if a backend that attached to a shared tree attempted to start iteration, it resulted in a crash. This commit resolves the issue by ensuring iter_context is created in RT_ATTACH(). This fix applies only to v17, w

pgsql: Add UUID version 7 generation function.

2024-12-11 Thread Masahiko Sawada
Aleksander Alekseev Reviewed-by: Masahiko Sawada, Lukas Fittl, Michael Paquier, Japin Li Reviewed-by: Marcos Pegoraro, Junwang Zhao, Stepan Neretin Reviewed-by: Daniel Vérité Discussion: https://postgr.es/m/CAAhFRxitJv%3DyoGnXUgeLB_O%2BM7J2BJAmb5jqAT9gZ3bij3uLDA%40mail.gmail.com Branch -- maste

pgsql: Unmark gen_random_uuid() function leakproof.

2024-12-11 Thread Masahiko Sawada
Unmark gen_random_uuid() function leakproof. The functions without arguments don't need to be marked leakproof. This commit unmarks gen_random_uuid() leakproof for consistency with upcoming UUID generation functions. Also, this commit adds a regression test to prevent reintroducing such cases. Bu

pgsql: Include necessary header files in radixtree.h.

2024-12-09 Thread Masahiko Sawada
Include necessary header files in radixtree.h. When #include'ing radixtree.h with RT_SHMEM, it could happen to raise compiler errors due to missing some declarations of types and functions. This commit also removes the inclusion of postgres.h since it's against our usual convention. Backpatch to

pgsql: Include necessary header files in radixtree.h.

2024-12-09 Thread Masahiko Sawada
Include necessary header files in radixtree.h. When #include'ing radixtree.h with RT_SHMEM, it could happen to raise compiler errors due to missing some declarations of types and functions. This commit also removes the inclusion of postgres.h since it's against our usual convention. Backpatch to

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix a possibility of logical replication slot's restart_lsn goin

2024-11-15 Thread Masahiko Sawada
Fix a possibility of logical replication slot's restart_lsn going backwards. Previously LogicalIncreaseRestartDecodingForSlot() accidentally accepted any LSN as the candidate_lsn and candidate_valid after the restart_lsn of the replication slot was updated, so it potentially caused the restart_lsn

pgsql: Fix typo in comment of gistdoinsert().

2024-11-04 Thread Masahiko Sawada
Fix typo in comment of gistdoinsert(). Author: Tender Wang Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/CAHewXN%3D3sH2sNw4nC3QGCEVw1Lftmw9m5y1Xje0bXK6ApDrsPQ%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Fix typo in tidstore.h.

2024-10-23 Thread Masahiko Sawada
Fix typo in tidstore.h. An oversight in commit f6bef362c. Reviewed-by: David Rowley Discussion: https://postgr.es/m/CAD21AoB8MJ5OHtpUw1UEGf7spioFmP3PNH44KNx6Yb3FiZSwKA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7b8b868aca184ae12e01d2f12d1

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Reduce memory block size for decoded tuple storage to 8kB.

2024-10-16 Thread Masahiko Sawada
Reduce memory block size for decoded tuple storage to 8kB. Commit a4ccc1cef introduced the Generation Context and modified the logical decoding process to use a Generation Context with a fixed block size of 8MB for storing tuple data decoded during logical decoding (i.e., rb->tup_context). Several

pgsql: Add contrib/pg_logicalinspect.

2024-10-14 Thread Masahiko Sawada
Add contrib/pg_logicalinspect. This module provides SQL functions that allow to inspect logical decoding components. It currently allows to inspect the contents of serialized logical snapshots of a running database cluster, which is useful for debugging or educational purposes. Author: Bertrand

pgsql: Move SnapBuild and SnapBuildOnDisk structs to snapshot_internal.

2024-10-14 Thread Masahiko Sawada
Move SnapBuild and SnapBuildOnDisk structs to snapshot_internal.h. This commit moves the definitions of the SnapBuild and SnapBuildOnDisk structs, related to logical snapshots, to the snapshot_internal.h file. This change allows external tools, such as pg_logicalinspect (with an upcoming patch), t

pgsql: Remove obsolete comment in reorderbuffer.h.

2024-10-14 Thread Masahiko Sawada
Remove obsolete comment in reorderbuffer.h. Commit 9fab40ad32e changed ReorderBuffer to use Slab Context for allocating ReorderBufferTXN entries instead of using a caching mechanism. The txn->node is no longer used as an element of the list of preallocated ReorderBufferTXNs. Reviewed-by: Amit Kap

pgsql: Use construct_array_builtin for FLOAT8OID instead of construct_a

2024-10-14 Thread Masahiko Sawada
Use construct_array_builtin for FLOAT8OID instead of construct_array. Commit d746021de1 introduced construct_array_builtin() for built-in data types, but forgot some replacements linked to FLOAT8OID. Author: Bertrand Drouvot Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/CAD21AoCE

pgsql: Add WAL usage reporting to ANALYZE VERBOSE output.

2024-09-09 Thread Masahiko Sawada
analyze operations. Author: Anthonin Bonnefoy Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/CAO6_Xqr__kTTCLkftqS0qSCm-J7_xbRG3Ge2rWhucxQJMJhcRA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bb7775234273268e8852068ee1a2eff9cd2a0020

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

pgsql: Clarify restrict_nonsystem_relation_kind description.

2024-08-30 Thread Masahiko Sawada
Clarify restrict_nonsystem_relation_kind description. This change improves the description of the restrict_nonsystem_relation_kind parameter in guc_table.c and the documentation for better clarity. Backpatch to 12, where this GUC parameter was introduced. Reviewed-by: Peter Eisentraut Discussion

Re: pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-29 Thread Masahiko Sawada
On Thu, Aug 29, 2024 at 7:29 AM Peter Eisentraut wrote: > > On 27.08.24 22:02, Masahiko Sawada wrote: > > On Tue, Aug 27, 2024 at 6:29 AM Tom Lane wrote: > >> > >> Peter Eisentraut writes: > >>> Maybe in the documentation it would also be appropriate

Re: pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-27 Thread Masahiko Sawada
other catalog-scanning tools might > like to use this too. > I've attached the patch to improve the descriptions while leaving this part. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com improve_description.patch Description: Binary data

pgsql: Fix identation.

2024-08-26 Thread Masahiko Sawada
Fix identation. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7229ebe011dff3f418251a4836f6d098923aa1e1 Modified Files -- src/backend/replication/logical/reorderbuffer.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-)

pgsql: Fix identation.

2024-08-26 Thread Masahiko Sawada
Fix identation. Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c739ae9e288c095cfe1b91ce27a2f2c075ed5da4 Modified Files -- src/backend/replication/logical/reorderbuffer.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-)

Re: pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-26 Thread Masahiko Sawada
On Mon, Aug 26, 2024 at 7:14 AM Peter Eisentraut wrote: > > On 05.08.24 15:07, Masahiko Sawada wrote: > > To address this, pg_dump now utilizes the newly introduced > > restrict_nonsystem_relation_kind GUC parameter to restrict the > > accesses to non-system views and f

pgsql: Fix memory counter update in ReorderBuffer.

2024-08-26 Thread Masahiko Sawada
Fix memory counter update in ReorderBuffer. Commit 5bec1d6bc5e changed the memory usage updates of the ReorderBufferTXN to zero all at once by subtracting txn->size, rather than updating it for each change. However, if TOAST reconstruction data remained in the transaction when freeing it, there we

pgsql: Fix memory counter update in ReorderBuffer.

2024-08-26 Thread Masahiko Sawada
Fix memory counter update in ReorderBuffer. Commit 5bec1d6bc5e changed the memory usage updates of the ReorderBufferTXN to zero all at once by subtracting txn->size, rather than updating it for each change. However, if TOAST reconstruction data remained in the transaction when freeing it, there we

pgsql: Add resource statistics reporting to ANALYZE VERBOSE.

2024-08-13 Thread Masahiko Sawada
resource statistics reporting to ANALYZE VERBOSE by reusing the same logging code as autoanalyze. Author: Anthonin Bonnefoy Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/CAO6_Xqr__kTTCLkftqS0qSCm-J7_xbRG3Ge2rWhucxQJMJhcRA%40mail.gmail.com Branch -- master Details --- https

pgsql: Use pgBufferUsage for buffer usage tracking in analyze.

2024-08-13 Thread Masahiko Sawada
message in both vacuum and analyze for better consistency. Author: Anthonin Bonnefoy Reviewed-by: Masahiko Sawada, Michael Paquier Discussion: https://postgr.es/m/CAO6_Xqr__kTTCLkftqS0qSCm-J7_xbRG3Ge2rWhucxQJMJhcRA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

  1   2   >