pgsql: amcheck: Fixes for right page check during unique constraint che

2024-05-25 Thread Alexander Korotkov
amcheck: Fixes for right page check during unique constraint check * Don't forget to pfree() the right page when it's to be ignored. * Report error on unexpected non-leaf right page even if this page is not to be ignored. This restores the logic which was unintendedly changed in

pgsql: Provide deterministic order for catalog queries in partition_spl

2024-05-25 Thread Alexander Korotkov
Provide deterministic order for catalog queries in partition_split.sql System catalog tables are subject to modification by parallel tests. This is the source of instability when querying them without explicit ORDER BY. This commit adds explicit ORDER BY to system catalog queries in

pgsql: Don't copy extended statistics during MERGE/SPLIT partition oper

2024-05-22 Thread Alexander Korotkov
esn't copy extended statistics. This commit makes createPartitionTable() behave consistently. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/ZiJW1g2nbQs9ekwK%40pryzbyj2023 Author: Alexander Korotkov, Justin Pryzby Branch -- master Details --- https://git.postgresql.org/pg/

pgsql: Fix the name collision detection in MERGE/SPLIT partition operat

2024-05-22 Thread Alexander Korotkov
RangeVarGetAndCheckCreationNamespace() and get_relname_relid(). Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/86b4f1e3-0b5d-315c-9225-19860d64d685%40gmail.com Author: Dmitry Koval, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: amcheck: Don't load the right sibling page into BtreeCheckState

2024-05-22 Thread Alexander Korotkov
amcheck: Don't load the right sibling page into BtreeCheckState 5ae2087202 implemented a cross-page unique constraint check by loading the right sibling to the BtreeCheckState.target variable. This is wrong, because bt_target_page_check() shouldn't change the target page. Also,

pgsql: amcheck: Refactoring the storage of the last visible entry

2024-05-22 Thread Alexander Korotkov
as individual function arguments. Reported-by: Alexander Korotkov Discussion: https://www.postgresql.org/message-id/CAPpHfdsVbB9ToriaB1UHuOKwjKxiZmTFQcEF%3DjuzzC_nby31uA%40mail.gmail.com Author: Pavel Borisov, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg

pgsql: amcheck: Report an error when the next page to a leaf is not a l

2024-05-22 Thread Alexander Korotkov
amcheck: Report an error when the next page to a leaf is not a leaf This is a very unlikely condition during checking a B-tree unique constraint, meaning that the index structure is violated badly, and we shouldn't continue checking to avoid endless loops, etc. So it's worth immediately throwing

pgsql: Fix regression tests conflict in 3ca43dbbb6

2024-05-13 Thread Alexander Korotkov
Fix regression tests conflict in 3ca43dbbb6 3ca43dbbb6 adds regression tests with permission checks. The conflict has been observed at buildfarm member piculet. This commit fixes the conflict in the following way. 1. partition_split.sql now uses role names regress_partition_split_alice and

pgsql: Add permission check for MERGE/SPLIT partition operations

2024-05-12 Thread Alexander Korotkov
by requiring owner permission on all the partitions involved. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/0520c72e-8d97-245e-53f9-173beca2ab2e%40gmail.com Author: Dmitry Koval, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Revert: Remove useless self-joins

2024-05-06 Thread Alexander Korotkov
Revert: Remove useless self-joins This commit reverts d3d55ce5713 and subsequent fixes 2b26a694554, 93c85db3b5b, b44a1708abe, b7f315c9d7d, 8a8ed916f73, b5fb6736ed3, 0a93f803f45, e0477837ce4, a7928a57b9f, 5ef34a8fc38, 30b4955a466, 8c441c08279, 028b15405b4, fe093994db4, 489072ab7a9, and

pgsql: Stabilize regression tests introduced by 259c96fa8f

2024-04-30 Thread Alexander Korotkov
Stabilize regression tests introduced by 259c96fa8f Add the ORDER BY clause to new queries to avoid ordering ambiguity. Per buildfarm member rorqual. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/449cdcd486bfc6864e4fa6784cc1526a94fe69db Modified Files

pgsql: Inherit parent's AM for partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Inherit parent's AM for partition MERGE/SPLIT operations This commit makes new partitions created by ALTER TABLE ... SPLIT PARTITION and ALTER TABLE ... MERGE PARTITIONS commands inherit the paret table access method. Reported-by: Alexander Lakhin Discussion:

pgsql: Change the way ATExecMergePartitions() handles the name collisio

2024-04-30 Thread Alexander Korotkov
with the right name immediately. This resolves the issue of the naming of related objects. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/edfbd846-dcc1-42d1-ac26-715691b687d3%40postgrespro.ru Author: Dmitry Koval, Alexander Korotkov Reviewed-by: Robert Haas, Justin Pryzby, Pavel Borisov Branch

pgsql: Add tab completion for partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Add tab completion for partition MERGE/SPLIT operations This commit implements psql tab completion for ALTER TABLE ... SPLIT PARTITION and ALTER TABLE ... MERGE PARTITIONS commands. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/5dee3937-8e9f-cca4-11fb-737709a92b37%40gmail.com

pgsql: Document the way partition MERGE/SPLIT operations create new par

2024-04-30 Thread Alexander Korotkov
Document the way partition MERGE/SPLIT operations create new partitions Reported-by: Justin Pryzby Discussion: https://postgr.es/m/ZilrByTp-pbz6Mvf%40pryzbyj2023 Reviewed-by: Justin Pryzby Branch -- master Details ---

pgsql: Rename tables in tests of partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Rename tables in tests of partition MERGE/SPLIT operations Replace "salesman" with "salesperson", "salesmen" with "salespeople". The names are both gramatically correct and gender-neutral. Reported-by: Alexander Lakhin Discussion:

pgsql: Fix error message in check_partition_bounds_for_split_range()

2024-04-30 Thread Alexander Korotkov
Fix error message in check_partition_bounds_for_split_range() Currently, the error message is produced by a system of complex substitutions making it quite untranslatable and hard to read. This commit splits this into 4 plain error messages suitable for translation. Reported-by: Kyotaro

pgsql: Make new partitions with parent's persistence during MERGE/SPLIT

2024-04-30 Thread Alexander Korotkov
partition. That doesn't lead to complications, because both callers have the parent table open and need to open the new partition. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/dbc8b96c-3cf0-d1ee-860d-0e491da20485%40gmail.com Author: Dmitry Koval Reviewed-by: Alexander Korotkov, Robert

Re: pgsql: Fix failure to track role dependencies of pg_init_privs entries.

2024-04-29 Thread Alexander Korotkov
On Tue, Apr 30, 2024 at 2:26 AM Tom Lane wrote: > Fix failure to track role dependencies of pg_init_privs entries. I just noticed that test_pg_dump checks don't pass for me. And for most of the buildfarm members too. You must be already aware of this, just in case. -- Regards, Alexan

pgsql: Refactoring for CommitTransactionCommand()/AbortCurrentTransacti

2024-04-17 Thread Alexander Korotkov
Refactoring for CommitTransactionCommand()/AbortCurrentTransaction() fefd9a3fed turned tail recursion of CommitTransactionCommand() and AbortCurrentTransaction() into iteration. However, it splits the handling of cases between different functions. This commit puts the handling of all the cases

pgsql: revert: Generalize relation analyze in table AM interface

2024-04-16 Thread Alexander Korotkov
revert: Generalize relation analyze in table AM interface This commit reverts 27bc1772fc and dd1f6b0c17. Per review by Andres Freund. Discussion: https://postgr.es/m/20240415201057.khoyxbwwxfgzomeo%40awork3.anarazel.de Branch -- master Details ---

pgsql: Grammar fixes for split/merge partitions code

2024-04-15 Thread Alexander Korotkov
Grammar fixes for split/merge partitions code The fixes relate to comments, error messages, and corresponding expected output of regression tests. Discussion: https://postgr.es/m/CAMbWs49DDsknxyoycBqiE72VxzL_sYHF6zqL8dSeNehKPJhkKg%40mail.gmail.com Discussion:

pgsql: Revert: Implement pg_wal_replay_wait() stored procedure

2024-04-11 Thread Alexander Korotkov
Revert: Implement pg_wal_replay_wait() stored procedure This commit reverts 06c418e163, e37662f221, bf1e650806, 25f42429e2, ee79928441, and 74eaf66f98 per review by Heikki Linnakangas. Discussion: https://postgr.es/m/b155606b-e744-4218-bda5-29379779da1a%40iki.fi Branch -- master Details

pgsql: Revert: Let table AM insertion methods control index insertion

2024-04-11 Thread Alexander Korotkov
Revert: Let table AM insertion methods control index insertion This commit reverts b1484a3f19 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details ---

pgsql: Revert: Allow table AM to store complex data structures in rd_am

2024-04-11 Thread Alexander Korotkov
Revert: Allow table AM to store complex data structures in rd_amcache This commit reverts 02eb07ea89 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details ---

pgsql: Revert: Allow table AM tuple_insert() method to return the diffe

2024-04-11 Thread Alexander Korotkov
Revert: Allow table AM tuple_insert() method to return the different slot This commit reverts c35a3fb5e0 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details ---

pgsql: Revert: Allow locking updated tuples in tuple_update() and tuple

2024-04-11 Thread Alexander Korotkov
Revert: Allow locking updated tuples in tuple_update() and tuple_delete() This commit reverts 87985cc925 and 818861eb57 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details ---

pgsql: Revert: Custom reloptions for table AM

2024-04-11 Thread Alexander Korotkov
Revert: Custom reloptions for table AM This commit reverts 9bd99f4c26 and 422041542f per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details ---

pgsql: revert: Transform OR clauses to ANY expression

2024-04-09 Thread Alexander Korotkov
revert: Transform OR clauses to ANY expression This commit reverts 72bd38cc99 due to implementation and design issues. Reported-by: Tom Lane Discussion: https://postgr.es/m/3604469.1712628736%40sss.pgh.pa.us Branch -- master Details ---

pgsql: Checks for ALTER TABLE ... SPLIT/MERGE PARTITIONS ... commands

2024-04-09 Thread Alexander Korotkov
Checks for ALTER TABLE ... SPLIT/MERGE PARTITIONS ... commands Check that the target partition actually belongs to the parent table. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/cd842601-cf1a-9806-f7b7-d2509b93ba61%40gmail.com Author: Dmitry Koval Branch -- master Details

pgsql: Provide a way block-level table AMs could re-use acquire_sample_

2024-04-08 Thread Alexander Korotkov
Provide a way block-level table AMs could re-use acquire_sample_rows() While keeping API the same, this commit provides a way for block-level table AMs to re-use existing acquire_sample_rows() by providing custom callbacks for getting the next block and the next tuple. Reported-by: Andres Freund

pgsql: Fix some grammer errors from error messages and codes comments

2024-04-08 Thread Alexander Korotkov
Fix some grammer errors from error messages and codes comments Discussion: https://postgr.es/m/CAHewXNkGMPU50QG7V6Q60JGFORfo8LfYO1_GCkCa0VWbmB-fEw%40mail.gmail.com Author: Tender Wang Branch -- master Details ---

pgsql: Fill CommonRdOptions with default values in extract_autovac_opts

2024-04-08 Thread Alexander Korotkov
Fill CommonRdOptions with default values in extract_autovac_opts() Reported-by: Thomas Munro Reported-by: Pavel Borisov Discussion: https://postgr.es/m/CA%2BhUKGLZzLR50RBvuqOO3MZ%3DF54ETz-rTp1PDX9uDGP_GqyYqA%40mail.gmail.com Branch -- master Details ---

Re: pgsql: Custom reloptions for table AM

2024-04-08 Thread Alexander Korotkov
Hi, Thomas! On Mon, Apr 8, 2024 at 12:03 PM Thomas Munro wrote: > I think this is uninitialised memory: I'm already working on this. Will be fixed in 10-15 minutes. -- Regards, Alexander Korotkov

pgsql: Custom reloptions for table AM

2024-04-08 Thread Alexander Korotkov
Custom reloptions for table AM Let table AM define custom reloptions for its tables. This allows specifying AM-specific parameters by the WITH clause when creating a table. The reloptions, which could be used outside of table AM, are now extracted into the CommonRdOptions data structure. These

Re: pgsql: Transform OR clauses to ANY expression

2024-04-08 Thread Alexander Korotkov
On Mon, Apr 8, 2024 at 9:24 AM Kyotaro Horiguchi wrote: > At Mon, 08 Apr 2024 14:46:57 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Sun, 07 Apr 2024 22:28:06 +0000, Alexander Korotkov > > wrote in > > > Transform OR clauses to ANY expression > > > >

pgsql: Fix the wording of or_to_any_transform_limit description

2024-04-08 Thread Alexander Korotkov
Fix the wording of or_to_any_transform_limit description Reported-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/20240408.144657.1746688590065601661.horikyota.ntt%40gmail.com Branch -- master Details ---

pgsql: Fix the value of or_to_any_transform_limit in postgresql.conf.sa

2024-04-08 Thread Alexander Korotkov
Fix the value of or_to_any_transform_limit in postgresql.conf.sample Reported-by: Justin Pryzby Discussion: https://postgr.es/m/ZhM8jH8gsKm5Q-9p%40pryzbyj2023 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2af75e1174786a02fc35755c0cb98c522d72a065 Modified Files

pgsql: Fix usage of same ListCell transform_or_to_any()'s in nested loo

2024-04-07 Thread Alexander Korotkov
Fix usage of same ListCell transform_or_to_any()'s in nested loops Discussion: https://postgr.es/m/CAAKRu_b4SXNW4GAM0bv3e6wcL5ODSXg1ZdRCn6uyLLjSPbveBg%40mail.gmail.com Author: Melanie Plageman Branch -- master Details ---

Re: pgsql: Transform OR clauses to ANY expression

2024-04-07 Thread Alexander Korotkov
On Mon, Apr 8, 2024 at 1:35 AM Melanie Plageman wrote: > On Sun, Apr 7, 2024 at 6:28 PM Alexander Korotkov > wrote: > > > > Transform OR clauses to ANY expression > > > > Replace (expr op C1) OR (expr op C2) ... with expr op ANY(ARRAY[C1, C2, > >

pgsql: Transform OR clauses to ANY expression

2024-04-07 Thread Alexander Korotkov
Reviewed-by: Peter Geoghegan Reviewed-by: Ranier Vilela Reviewed-by: Alexander Korotkov Reviewed-by: Robert Haas Reviewed-by: Jian He Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/72bd38cc99a15da6f97373fae98027c908c398ea Modified Files -- doc/src/sgml

pgsql: Implement ALTER TABLE ... MERGE PARTITIONS ... command

2024-04-06 Thread Alexander Korotkov
Implement ALTER TABLE ... MERGE PARTITIONS ... command This new DDL command merges several partitions into the one partition of the target table. The target partition is created using new createPartitionTable() function with parent partition as the template. This commit comprises quite naive

pgsql: Implement ALTER TABLE ... SPLIT PARTITION ... command

2024-04-06 Thread Alexander Korotkov
Implement ALTER TABLE ... SPLIT PARTITION ... command This new DDL command splits a single partition into several parititions. Just like ALTER TABLE ... MERGE PARTITIONS ... command, new patitions are created using createPartitionTable() function with parent partition as the template. This

pgsql: Use an LWLock instead of a spinlock in waitlsn.c

2024-04-06 Thread Alexander Korotkov
Use an LWLock instead of a spinlock in waitlsn.c This should prevent busy-waiting when number of waiting processes is high. Discussion: https://postgr.es/m/202404030658.hhj3vfxeyhft%40alvherre.pgsql Author: Alvaro Herrera Branch -- master Details ---

pgsql: Call WaitLSNCleanup() in AbortTransaction()

2024-04-06 Thread Alexander Korotkov
Call WaitLSNCleanup() in AbortTransaction() Even though waiting for replay LSN happens without explicit transaction, AbortTransaction() is responsible for the cleanup of the shared memory if the error is thrown in a stored procedure. So, we need to do WaitLSNCleanup() there to clean up after

pgsql: Clarify what is protected by WaitLSNLock

2024-04-06 Thread Alexander Korotkov
Clarify what is protected by WaitLSNLock Not just WaitLSNState.waitersHeap, but also WaitLSNState.procInfos and updating of WaitLSNState.minWaitedLSN is protected by WaitLSNLock. There is one now documented exclusion on fast-path checking of WaitLSNProcInfo.inHeap flag. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Fix the parameters order for TableAmRoutine.relation_copy_for_cl

2024-04-03 Thread Alexander Korotkov
Fix the parameters order for TableAmRoutine.relation_copy_for_cluster() Specify OldTable first, NewTable second as used by table_relation_copy_for_cluster() and as implemented in heapam_relation_copy_for_cluster(). Backpatch to PostgreSQL 12, where TableAmRoutine was introduced. Discussion:

pgsql: Use the pairing heap instead of a flat array for LSN replay wait

2024-04-03 Thread Alexander Korotkov
Use the pairing heap instead of a flat array for LSN replay waiters 06c418e163 introduced pg_wal_replay_wait() procedure allowing to wait for the particular LSN to be replayed on standby. The waiters were stored in the flat array. Even though scanning small arrays is fast, that might be a

pgsql: Minor improvements for waitlsn.c

2024-04-03 Thread Alexander Korotkov
Minor improvements for waitlsn.c * Remove extra includes * Fill 'cur' in addLSNWaiter() before taking the spinlock * Initialize 'endtime' with zero in WaitForLSN() to avoid compiler warning Reported-by: Alvaro Herrera, Masahiko Sawada, Daniel Gustafsson Discussion:

pgsql: Move WaitLSNShmemInit() to CreateOrAttachShmemStructs()

2024-04-02 Thread Alexander Korotkov
Move WaitLSNShmemInit() to CreateOrAttachShmemStructs() Thanks to Andres Freund, Thomas Munrom and David Rowley for investigating this issue. Discussion: https://postgr.es/m/CAPpHfdvap5mMLikt8CUjA0osAvCJHT0qnYeR3f84EJ_Kvse0mg%40mail.gmail.com Branch -- master Details ---

Re: pgsql: Allow SIGINT to cancel psql database reconnections.

2024-04-02 Thread Alexander Korotkov
Fennema-Nio, and me. > > Discussion: http://postgr.es/m/d08wwcpvhkhn.3qelikzj2d...@neon.tech This appears to have missing pgindent. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=koel=2024-04-02%2021%3A19%3A02 -- Regards, Alexander Korotkov

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-04-02 Thread Alexander Korotkov
On Tue, Apr 2, 2024 at 10:58 PM Alexander Korotkov wrote: > Implement pg_wal_replay_wait() stored procedure I'm trying to figure out if this failure could be related to this commit... https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=culicidae=2024-04-02%2020%3A24%3A55 -- Rega

pgsql: Implement pg_wal_replay_wait() stored procedure

2024-04-02 Thread Alexander Korotkov
/eb12f9b03851bb2583adab5df9579b4b%40postgrespro.ru Author: Kartyshov Ivan, Alexander Korotkov Reviewed-by: Michael Paquier, Peter Eisentraut, Dilip Kumar, Amit Kapila Reviewed-by: Alexander Lakhin, Bharath Rupireddy, Euler Taveira Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Revert "Custom reloptions for table AM"

2024-04-02 Thread Alexander Korotkov
Revert "Custom reloptions for table AM" This reverts commit c95c25f9af4bc77f2f66a587735c50da08c12b37 due to multiple design issues spotted after commit. Reported-by: Jeff Davis Discussion: https://postgr.es/m/11550b536211d5748bb2865ed6cb3502ff073bf7.camel%40j-davis.com Branch -- master

pgsql: Custom reloptions for table AM

2024-03-30 Thread Alexander Korotkov
Custom reloptions for table AM Let table AM define custom reloptions for its tables. This allows to specify AM-specific parameters by WITH clause when creating a table. The code may use some parts from prior work by Hao Wu. Discussion:

pgsql: Generalize relation analyze in table AM interface

2024-03-30 Thread Alexander Korotkov
Generalize relation analyze in table AM interface Currently, there is just one algorithm for sampling tuples from a table written in acquire_sample_rows(). Custom table AM can just redefine the way to get the next block/tuple by implementing scan_analyze_next_block() and

pgsql: Let table AM insertion methods control index insertion

2024-03-30 Thread Alexander Korotkov
Let table AM insertion methods control index insertion Previously, the executor did index insert unconditionally after calling table AM interface methods tuple_insert() and multi_insert(). This commit introduces the new parameter insert_indexes for these two methods. Setting '*insert_indexes'

pgsql: Fix some typos and grammar issues from commit 87985cc92522

2024-03-27 Thread Alexander Korotkov
Fix some typos and grammar issues from commit 87985cc92522 Reported-by: Alexander Lakhin Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/818861eb578663a0d4d8d7dc4e18c96a148b3c75 Modified Files -- src/backend/access/heap/heapam.c | 2 +-

pgsql: Add comments on some MinimalTupleSlots methods usage

2024-03-25 Thread Alexander Korotkov
Add comments on some MinimalTupleSlots methods usage Discussion: https://postgr.es/m/CALT9ZEHNeagO5PLb4Nv9J_ZaCtp%2BArdVmbSLc0RHUzx_RPAa4w%40mail.gmail.com Author: Pavel Borisov Branch -- master Details ---

pgsql: Improve error message for tts_(virtual|minimal)_is_current_xact_

2024-03-25 Thread Alexander Korotkov
Improve error message for tts_(virtual|minimal)_is_current_xact_tuple Discussion: https://postgr.es/m/CALT9ZEHNeagO5PLb4Nv9J_ZaCtp%2BArdVmbSLc0RHUzx_RPAa4w%40mail.gmail.com Author: Pavel Borisov Branch -- master Details ---

pgsql: Allow locking updated tuples in tuple_update() and tuple_delete(

2024-03-25 Thread Alexander Korotkov
Allow locking updated tuples in tuple_update() and tuple_delete() Currently, in read committed transaction isolation mode (default), we have the following sequence of actions when tuple_update()/tuple_delete() finds the tuple updated by the concurrent transaction. 1. Attempt to update/delete

pgsql: Add EvalPlanQual delete returning isolation test

2024-03-25 Thread Alexander Korotkov
Add EvalPlanQual delete returning isolation test Author: Andres Freund Reviewed-by: Pavel Borisov Discussion: https://www.postgresql.org/message-id/flat/CAPpHfdua-YFw3XTprfutzGp28xXLigFtzNbuFY8yPhqeq6X5kg%40mail.gmail.com Branch -- master Details ---

pgsql: reindexdb: Fix warning about uninitialized indices_tables_cell

2024-03-25 Thread Alexander Korotkov
reindexdb: Fix warning about uninitialized indices_tables_cell Initialize indices_tables_cell with NULL to silence the warning. Also, refactor the place of the first assignment of indices_tables_cell. Reported-by: Thomas Munro, David Rowley, Tom Lane, Richard Guo Discussion:

pgsql: reindexdb: Add the index-level REINDEX with multiple jobs

2024-03-24 Thread Alexander Korotkov
is also rebuilt to match that order. Later during processingof that list, we push indexes belonging to the same table into the same job. Discussion: https://postgr.es/m/CACG%3DezZU_VwDi-1PN8RUSE6mcYG%2BYx1NH_rJO4%2BKe-mKqLp%3DNw%40mail.gmail.com Author: Maxim Orlov, Svetlana Derevyanko, Alexander

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- master Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- master Details --- https

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_16_STABLE Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_15_STABLE Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_16_STABLE Details --- https

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_15_STABLE Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_14_STABLE Details --- https

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_13_STABLE Details --- https

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https

pgsql: amcheck: Support for different header sizes of short varlena dat

2024-03-23 Thread Alexander Korotkov
to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Michael Zhilin Reviewed-by: Alexander Lakhin, Andrey Borodin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_14_STABLE Details --- https

pgsql: amcheck: Normalize index tuples containing uncompressed varlena

2024-03-23 Thread Alexander Korotkov
. Backpatch to all supported versions. Discussion: https://postgr.es/m/flat/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc%40postgrespro.ru Author: Andrey Borodin Reviewed-by: Alexander Lakhin, Michael Zhilin, Jian He, Alexander Korotkov Backpatch-through: 12 Branch -- REL_13_STABLE Details --- https

pgsql: Fix an oversight in refactoring in 06b10f80ba4.

2024-03-22 Thread Alexander Korotkov
Fix an oversight in refactoring in 06b10f80ba4. It was against intended skipping prechecking keys optimization in the first page of range queries to not influence point queries performance. Reported-by: Anton Melnikov Discussion:

pgsql: Allow table AM tuple_insert() method to return the different slo

2024-03-21 Thread Alexander Korotkov
Allow table AM tuple_insert() method to return the different slot This allows table AM to return a native tuple slot even if VirtualTupleTableSlot is given as an input. Native tuple slots have knowledge about system attributes, which could be accessed in the future. table_multi_insert() method

pgsql: Add TupleTableSlotOps.is_current_xact_tuple() method

2024-03-21 Thread Alexander Korotkov
Add TupleTableSlotOps.is_current_xact_tuple() method This allows us to abstract how/whether table AM uses transaction identifiers. A custom table AM can use a custom slot, which may not store xmin directly, but determine the tuple belonging to the current transaction in the other way.

pgsql: Allow table AM to store complex data structures in rd_amcache

2024-03-21 Thread Alexander Korotkov
Allow table AM to store complex data structures in rd_amcache The new table AM method free_rd_amcache is responsible for freeing all the memory related to rd_amcache and setting free_rd_amcache to NULL. If the new method is not specified, we still assume rd_amcache to be a single chunk of

pgsql: psql: fix variable existence tab completion

2024-03-16 Thread Alexander Korotkov
psql: fix variable existence tab completion psql has the :{?name} syntax for testing for a psql variable existence. This commit implements a tab completion for this syntax. Notably, in order to implement this we have to remove '{' from WORD_BREAKS. It appears that '{' here from the very

pgsql: Use locale-aware value for \watch in 005_timeouts.pl

2024-03-15 Thread Alexander Korotkov
Use locale-aware value for \watch in 005_timeouts.pl Reported-by: Alexander Lakhin Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/605062227fdc8331f2ffa0f60e7a8724b6e56480 Modified Files -- src/test/modules/test_misc/t/005_timeouts.pl | 18

Re: pgsql: Add TAP tests for timeouts

2024-03-15 Thread Alexander Korotkov
On Fri, Mar 15, 2024 at 2:25 PM Andrey M. Borodin wrote: > > On 15 Mar 2024, at 16:30, Alexander Korotkov wrote: > > > > Maybe, but do you see any negative side effects of the unconditionally > > unset of flags? > > Nope, just expressed possible option. > &g

pgsql: Fix wordings in timeouts TAP test

2024-03-15 Thread Alexander Korotkov
Fix wordings in timeouts TAP test Reported-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/20240315.104235.1835366724413653745.horikyota.ntt%40gmail.com Author: Andrey Borodin Branch -- master Details ---

pgsql: Fix race condition in transaction timeout TAP tests

2024-03-15 Thread Alexander Korotkov
Fix race condition in transaction timeout TAP tests The interruption handler within the injection point can get stuck in an infinite loop while handling transaction timeout. To avoid this situation we reset the timeout flag before invoking the injection point. Author: Alexander Korotkov Reviewed

Re: pgsql: Add TAP tests for timeouts

2024-03-15 Thread Alexander Korotkov
On Fri, Mar 15, 2024 at 1:27 PM Andrey M. Borodin wrote: > > > On 15 Mar 2024, at 15:44, Alexander Korotkov wrote: > > > > We loop in the interrupt checking, given that the injection point handler > > checks for interrupts internally. I propose to unset t

Re: pgsql: Add TAP tests for timeouts

2024-03-15 Thread Alexander Korotkov
tart_call_main.h:58:16 frame #27: 0x7f3756e28209 libc.so.6`__libc_start_main_impl(main=(postgres`main at main.c:59:1), argc=4, argv=0x7c17e678, init=, fini=, rtld_fini=, stack_end=0x7c17e668) at libc-start.c:360:3 frame #28: 0x556a2f8cbb75 postgres`_start + 37

pgsql: Fix contrib/pg_visibility/meson.build

2024-03-14 Thread Alexander Korotkov
Fix contrib/pg_visibility/meson.build I broke that in e85662df44ff by oversight. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c20d90a41ca869f9c6dd4058ad1c7f5c9ee9d912 Modified Files -- contrib/pg_visibility/meson.build | 1 + 1 file changed, 1

pgsql: Add TAP tests for timeouts

2024-03-14 Thread Alexander Korotkov
. Discussion: https://postgr.es/m/CAAhFRxiQsRs2Eq5kCo9nXE3HTugsAAJdSQSmxncivebAxdmBjQ%40mail.gmail.com Author: Andrey Borodin Reviewed-by: Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/eeefd4280f6e5167d70efabb89586b7d38922d95 Modified Files

pgsql: Fix false reports in pg_visibility

2024-03-14 Thread Alexander Korotkov
Fix false reports in pg_visibility Currently, pg_visibility computes its xid horizon using the GetOldestNonRemovableTransactionId(). The problem is that this horizon can sometimes go backward. That can lead to reporting false errors. In order to fix that, this commit implements a new function

pgsql: Improve documentation for pg_stat_checkpointer fields

2024-03-13 Thread Alexander Korotkov
Improve documentation for pg_stat_checkpointer fields pg_stat_checkpointer contains statistics for checkpoints and restartpoints. Before 12915a58eec9 documentation said only about checkpoints implying that restartpoint is the variation of checkpoint. 12915a58eec9 introduced new separate

pgsql: Backpatch missing check_stack_depth() to some recursive function

2024-03-10 Thread Alexander Korotkov
Backpatch missing check_stack_depth() to some recursive functions Backpatch changes from d57b7cc333, 75bcba6cbd to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru Branch -- REL_15_STABLE Details ---

pgsql: Backpatch missing check_stack_depth() to some recursive function

2024-03-10 Thread Alexander Korotkov
Backpatch missing check_stack_depth() to some recursive functions Backpatch changes from d57b7cc333, 75bcba6cbd to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru Branch -- REL_16_STABLE Details ---

pgsql: Backpatch missing check_stack_depth() to some recursive function

2024-03-10 Thread Alexander Korotkov
Backpatch missing check_stack_depth() to some recursive functions Backpatch changes from d57b7cc333, 75bcba6cbd to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru Branch -- REL_14_STABLE Details ---

pgsql: Backpatch missing check_stack_depth() to some recursive function

2024-03-10 Thread Alexander Korotkov
Backpatch missing check_stack_depth() to some recursive functions Backpatch changes from d57b7cc333, 75bcba6cbd to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru Branch -- REL_13_STABLE Details ---

  1   2   3   4   5   6   7   >