pgsql: Fix oversized memory allocation in Parallel Hash Join

2024-01-06 Thread Alexander Korotkov
%40postgresql.org Author: Thomas Munro, Andrei Lepikhov, Alexander Korotkov Reviewed-by: Alena Rybakina Backpatch-through: 12 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2a67b5a60ee68892bb028587ddc6de7650822480 Modified Files -- src/backend/executor/nodeHash.c | 12

pgsql: Fix oversized memory allocation in Parallel Hash Join

2024-01-06 Thread Alexander Korotkov
%40postgresql.org Author: Thomas Munro, Andrei Lepikhov, Alexander Korotkov Reviewed-by: Alena Rybakina Backpatch-through: 12 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1a7c03e6fc75d2a5ee4893252d47f0549f078494 Modified Files -- src/backend/executor

pgsql: Fix oversized memory allocation in Parallel Hash Join

2024-01-06 Thread Alexander Korotkov
%40postgresql.org Author: Thomas Munro, Andrei Lepikhov, Alexander Korotkov Reviewed-by: Alena Rybakina Backpatch-through: 12 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/60de25c6efc8e5283094c74824f46f71ae483a8f Modified Files -- src/backend/executor

pgsql: Fix oversized memory allocation in Parallel Hash Join

2024-01-06 Thread Alexander Korotkov
%40postgresql.org Author: Thomas Munro, Andrei Lepikhov, Alexander Korotkov Reviewed-by: Alena Rybakina Backpatch-through: 12 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3bdaa8fc622f51ab2836314a9f087b6af81eef06 Modified Files -- src/backend/executor

pgsql: Fix oversized memory allocation in Parallel Hash Join

2024-01-06 Thread Alexander Korotkov
%40postgresql.org Author: Thomas Munro, Andrei Lepikhov, Alexander Korotkov Reviewed-by: Alena Rybakina Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/72d5b27763a86c1d9af79e3169aef885b79373a3 Modified Files -- src/backend/executor

pgsql: Fix the issue that SJE mistakenly omits qual clauses

2024-01-06 Thread Alexander Korotkov
Fix the issue that SJE mistakenly omits qual clauses When the SJE code handles the transfer of qual clauses from the removed relation to the remaining one, it replaces the Vars of the removed relation with the Vars of the remaining relation for each clause, and then reintegrates these clauses into

pgsql: Replace the relid in some missing fields during SJE

2024-01-01 Thread Alexander Korotkov
Replace the relid in some missing fields during SJE Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/a89f480f-8143-0965-f22d-0a892777f501%40gmail.com Author: Andrei Lepikhov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a7928a57b9f00c14dd1e257aaad9bff

Re: pgsql: Make all Perl warnings fatal

2023-12-29 Thread Alexander Korotkov
t Files=4, Tests=188, 4 wallclock secs ( 0.04 usr 0.01 sys + 0.98 cusr 1.68 csys = 2.71 CPU) Result: FAIL make: *** [check] Error 1 -- Regards, Alexander Korotkov

pgsql: Improvements and fixes for e0b1ee17dc

2023-12-27 Thread Alexander Korotkov
Improvements and fixes for e0b1ee17dc e0b1ee17dc introduced optimization for matching B-tree scan keys required for the directional scan. However, it incorrectly assumed that all keys required for opposite direction scan are satisfied by _bt_first(). It has been illustrated that with multiple sc

pgsql: Remove BTScanOpaqueData.firstPage

2023-12-27 Thread Alexander Korotkov
Remove BTScanOpaqueData.firstPage It's not necessary to keep the firstPage flag as a field of BTScanOpaqueData. This commit makes it an argument of the _bt_readpage() function. We can easily distinguish first-time and repeated calls (within the scan) of this function. Reported-by: Peter Geoghega

pgsql: Add asserts to bimapset manipulation functions

2023-12-26 Thread Alexander Korotkov
Add asserts to bimapset manipulation functions New asserts validate that arguments are really bitmapsets. This should help to early detect accesses to dangling pointers. Discussion: https://postgr.es/m/CAMbWs4_wJthNtYBL%2BSsebpgF-5L2r5zFFk6xYbS0A78GKOTFHw%40mail.gmail.com Reviewed-by: Richard G

pgsql: Make replace_relid() leave argument unmodified

2023-12-26 Thread Alexander Korotkov
Make replace_relid() leave argument unmodified There are a lot of situations when we share the same pointer to a Bitmapset structure across different places. In order to evade undesirable side effects replace_relid() function should always return a copy. Reported-by: Richard Guo Discussion: htt

pgsql: REALLOCATE_BITMAPSETS manual compile-time option

2023-12-26 Thread Alexander Korotkov
REALLOCATE_BITMAPSETS manual compile-time option This option forces each bitmapset modification to reallocate bitmapset. This is useful for debugging hangling pointers to bitmapset's. Discussion: https://postgr.es/m/CAMbWs4_wJthNtYBL%2BSsebpgF-5L2r5zFFk6xYbS0A78GKOTFHw%40mail.gmail.com Reviewed

pgsql: Don't constrain self-join removal due to PHVs

2023-12-24 Thread Alexander Korotkov
Don't constrain self-join removal due to PHVs Self-join removal appears to be safe to apply with placeholder variables as long as we handle PlaceHolderVar in replace_varno_walker() and replace relid in phinfo->ph_lateral. Discussion: https://postgr.es/m/18187-831da249cbd2ff8e%40postgresql.org Aut

pgsql: Handle PlaceHolderVar case in replace_varno_walker

2023-12-24 Thread Alexander Korotkov
Handle PlaceHolderVar case in replace_varno_walker This commit also retires sje_walker. This increases the generalty of replacing varno in the parse tree and simplifies the code. Discussion: https://postgr.es/m/18187-831da249cbd2ff8e%40postgresql.org Author: Richard Guo Reviewed-by: Andrei Lepik

pgsql: Fix a comment for remove_self_joins_recurse()

2023-12-24 Thread Alexander Korotkov
Fix a comment for remove_self_joins_recurse() Discussion: https://postgr.es/m/18187-831da249cbd2ff8e%40postgresql.org Author: Richard Guo Reviewed-by: Andrei Lepikhov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0a93f803f45f45f39473e2c61923c4b4777bc8a8 Modified

pgsql: Enhance checkpointer restartpoint statistics

2023-12-24 Thread Alexander Korotkov
requests may fail. System catalog is changed. Catversion is bumped. Discussion: https://postgr.es/m/99b2ccd1-a77a-962a-0837-191cdf56c2b9%40inbox.ru Author: Anton A. Melnikov Reviewed-by: Kyotaro Horiguchi, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg

pgsql: Add support for deparsing semi-joins to contrib/postgres_fdw

2023-12-05 Thread Alexander Korotkov
Add support for deparsing semi-joins to contrib/postgres_fdw SEMI-JOIN is deparsed as the EXISTS subquery. It references outer and inner relations, so it should be evaluated as the condition in the upper-level WHERE clause. The signatures of deparseFromExprForRel() and deparseRangeTblRef() are rev

pgsql: Fix typo in 5a1dfde8334b

2023-11-30 Thread Alexander Korotkov
Fix typo in 5a1dfde8334b Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/55d8800f-4a80-5256-1e84-246fbe79a...@gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ae2ccf66a261caac9701986597e3f29188f890d6 Modified Files -- src/backend/

pgsql: Fix warning due non-standard inline declaration in 4ed8f0913bfdb

2023-11-30 Thread Alexander Korotkov
Fix warning due non-standard inline declaration in 4ed8f0913bfdb5f355 Reported-by: Alexander Lakhin, Tom Lane Author: Pavel Borisov Discussion: https://postgr.es/m/55d8800f-4a80-5256-1e84-246fbe79a...@gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b589f21

pgsql: Use larger segment file names for pg_notify

2023-11-28 Thread Alexander Korotkov
consume up to 8 GB of disk space which is exactly the limit we had previously. Author: Maxim Orlov, Aleksander Alekseev, Alexander Korotkov, Teodor Sigaev Author: Nikita Glukhov, Pavel Borisov, Yura Sokolov Reviewed-by: Jacob Champion, Heikki Linnakangas, Alexander Korotkov Reviewed-by: Japin Li

pgsql: Make use FullTransactionId in 2PC filenames

2023-11-28 Thread Alexander Korotkov
Korotkov, Teodor Sigaev Author: Nikita Glukhov, Pavel Borisov, Yura Sokolov Reviewed-by: Jacob Champion, Heikki Linnakangas, Alexander Korotkov Reviewed-by: Japin Li, Pavel Borisov, Tom Lane, Peter Eisentraut, Andres Freund Reviewed-by: Andrey Borodin, Dilip Kumar, Aleksander Alekseev Discussion

pgsql: Index SLRUs by 64-bit integers rather than by 32-bit integers

2023-11-28 Thread Alexander Korotkov
ch of problems and improve the overall reliability of the system. This particular patch however only changes the indexing and doesn't address the wraparound per se. This is going to be done in the following patches. Author: Maxim Orlov, Aleksander Alekseev, Alexander Korotkov, Teodor Sigaev Auth

pgsql: Add SLRU tests for 64-bit page case

2023-11-28 Thread Alexander Korotkov
Add SLRU tests for 64-bit page case 4ed8f0913b added 64-bit page numbering for SLRU. This commit adds tests for page numbers higher than 2^32. Author: Maxim Orlov Reviewed-by: Aleksander Alekseev, Alexander Korotkov Discussion: https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe

pgsql: Add NOT NULL checking of pg_stat_statements_reset() in tests

2023-11-26 Thread Alexander Korotkov
Add NOT NULL checking of pg_stat_statements_reset() in tests This is preliminary patch. It adds NOT NULL checking for the result of pg_stat_statements_reset() function. It is needed for upcoming patch "Track statement entry timestamp" that will change the result type of this function to the times

pgsql: Track statement entry timestamp in contrib/pg_stat_statements

2023-11-26 Thread Alexander Korotkov
Track statement entry timestamp in contrib/pg_stat_statements This patch adds 'stats_since' and 'minmax_stats_since' columns to the pg_stat_statements view and pg_stat_statements() function. The new min/max reset mode for the pg_stat_stetments_reset() function is controlled by the parameter minma

pgsql: Update comments for pg_statistic catalog table

2023-11-26 Thread Alexander Korotkov
Update comments for pg_statistic catalog table Make a reminder that pg_stats view needs to be modified whenever a new slot kind is added. To prevent situations like 918eee0c49 when pg_stats was forgotten to be updated. Also, revise the comment that only non-null, non-empty rows are considered fo

pgsql: Display length and bounds histograms in pg_stats

2023-11-26 Thread Alexander Korotkov
Display length and bounds histograms in pg_stats Values corresponding to STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM and STATISTIC_KIND_BOUNDS_HISTOGRAM were not exposed to pg_stats when these slot kinds were introduced in 918eee0c49. This commit adds the missing fields to pg_stats. Catversion is bump

pgsql: Fix how SJE checks against PHVs

2023-11-10 Thread Alexander Korotkov
Fix how SJE checks against PHVs It seems that a PHV evaluated/needed at or below the self join should not have a problem if we remove the self join. But this requires further investigation. For now, we just do not remove self joins if the rel to be removed is laterally referenced by PHVs. Discus

pgsql: Fix the way SJE removes references from PHVs

2023-11-09 Thread Alexander Korotkov
Fix the way SJE removes references from PHVs Add missing replacement of relids in phv->phexpr. Also, remove extra replace_relid() over phv->phrels. Reported-by: Zuming Jiang Bug: #18187 Discussion: https://postgr.es/m/flat/18187-831da249cbd2ff8e%40postgresql.org Author: Richard Guo Reviewed-by:

pgsql: Fix allocation of UniqueRelInfo

2023-11-06 Thread Alexander Korotkov
Fix allocation of UniqueRelInfo Reported-by: Richard Guo Discussion: https://postgr.es/m/CAMbWs4_STsG1PKQBuvQC8W4sPo3KvML3=jotjkluyquk3g8...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/93c85db3b5b8d8d15b10b4c66a0e6961028470d4 Modified Files

pgsql: Fix usage of the parse tree for estimate_num_groups() in set ope

2023-11-03 Thread Alexander Korotkov
f-join removal. In future, we may think about maintaining just one copy of the parse tree and/or keeping removed relids as aliases. Reported-by: Zuming Jiang Bug: #18170 Discussion: https://postgr.es/m/flat/18170-f1d17bf9a0d58b24%40postgresql.org Author: Richard Guo, Alexander Korotkov Reviewed-

pgsql: Fix indentation in contrib/amcheck/verify_nbtree.c

2023-10-30 Thread Alexander Korotkov
Fix indentation in contrib/amcheck/verify_nbtree.c Reported-by: Michael Paquier Discussion: https://postgr.es/m/ZT9YoDPEQBUMrIHg%40paquier.xyz Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/675fed4df5db4e78d40a0ce9cb785cfba9fa480f Modified Files -- con

Re: pgsql: Teach contrib/amcheck to check the unique constraint violation

2023-10-30 Thread Alexander Korotkov
On Mon, Oct 30, 2023 at 9:18 AM Michael Paquier wrote: > On Fri, Oct 27, 2023 at 09:21:50PM +0000, Alexander Korotkov wrote: > > Teach contrib/amcheck to check the unique constraint violation > > > > Add the 'checkunique' argument to bt_index_check() and > >

pgsql: Fix instable 006_login_trigger.pl test

2023-10-29 Thread Alexander Korotkov
Fix instable 006_login_trigger.pl test Handling of login trigger FATAL error could cause a timing-dependant panic of IPC::Run. This commit excludes checks which involves handling of such errors. Reported-by: Tom Lane Discussion: https://postgr.es/m/2268825.1698618066%40sss.pgh.pa.us Branch

pgsql: Teach contrib/amcheck to check the unique constraint violation

2023-10-27 Thread Alexander Korotkov
Teach contrib/amcheck to check the unique constraint violation Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check(). When the flag is specified the procedures will check the unique constraint violation for unique indexes. Only one heap entry for all equal keys in the ind

Re: pgsql: Adjust parallel_schedule with event triggers on authenticated lo

2023-10-27 Thread Alexander Korotkov
On Fri, Oct 27, 2023 at 2:51 PM Alvaro Herrera wrote: > On 2023-Oct-27, Alexander Korotkov wrote: > > > OK, I'm good with this. > > Do you like me to push this? Or do you like to push it yourself? > > Please do. Done, thanks. -- Regards, Alexander Korotkov

pgsql: Split event_trigger_login test from event_trigger test

2023-10-27 Thread Alexander Korotkov
Split event_trigger_login test from event_trigger test That allows to still run event_trigger test in parallel with oidjoins test, and save ~50ms of tests runtime. Discussion: https://postgr.es/m/202310271047.mnwkql6nhbwi%40alvherre.pgsql Author: Alvaro Herrera, Alexander Korotkov Branch

Re: pgsql: Adjust parallel_schedule with event triggers on authenticated lo

2023-10-27 Thread Alexander Korotkov
On Fri, Oct 27, 2023 at 1:48 PM Alvaro Herrera wrote: > On 2023-Oct-27, Alexander Korotkov wrote: > > > Adjust parallel_schedule with event triggers on authenticated login > > > > Event triggers on authenticated login could catch the connection of the > > concurr

pgsql: Adjust parallel_schedule with event triggers on authenticated lo

2023-10-27 Thread Alexander Korotkov
Adjust parallel_schedule with event triggers on authenticated login Event triggers on authenticated login could catch the connection of the concurrent test. In order to prevent this side effect we need to run the event_trigger test alone. Discussion: https://postgr.es/m/flat/camev5_ss5g7k1pcv2o

pgsql: Make UniqueRelInfo a node

2023-10-26 Thread Alexander Korotkov
Make UniqueRelInfo a node d3d55ce571 changed RelOptInfo.unique_for_rels from the list of Relid sets to the list of UniqueRelInfo's. But it didn't make UniqueRelInfo a node. This commit makes UniqueRelInfo a node. Also this commit revises some comments related to RelOptInfo.unique_for_rels. Repo

Re: pgsql: Remove useless self-joins

2023-10-25 Thread Alexander Korotkov
On Wed, Oct 25, 2023 at 1:31 PM David Rowley wrote: > > On Wed, 25 Oct 2023 at 22:59, Alexander Korotkov > wrote: > > src/test/regress/sql/join.sql | 359 > > There seems to be a few EXPLAINs added here that didn't include costs off. Thank yo

pgsql: Fix some regression tests for d3d55ce57136

2023-10-25 Thread Alexander Korotkov
Fix some regression tests for d3d55ce57136 Add missing (cost off) to explain. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9ba9c7074fa76787530ac0d50313e317ac7032b9 Modified Files -- src/test/regress/expected/join.out | 33 ++--

pgsql: Remove useless self-joins

2023-10-25 Thread Alexander Korotkov
Rybakina Reviewed-by: Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d3d55ce571369dad6e1d582f1655e5a3fbd8594a Modified Files -- doc/src/sgml/config.sgml | 16 + src/backend/optimizer/path/indxpath.c | 39 + src

pgsql: Run 006_login_trigger.pl only with Unix-domain sockets

2023-10-16 Thread Alexander Korotkov
Run 006_login_trigger.pl only with Unix-domain sockets Per report from buildfarm member drongo. Reported-by: Alexander Lakhin Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6fcaeb0ea26b963b0ca13ce6078df4c2c3135aa3 Modified Files -- src/test/authentica

pgsql: List 006_login_trigger.pl test for meson

2023-10-16 Thread Alexander Korotkov
List 006_login_trigger.pl test for meson Reported-by: Thomas Munro Discussion: https://postgr.es/m/CA%2BhUKGLuqDUaYYhJnA1H1q5Z-k18kQHoEqZ5fiXtTi4038nspg%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5abbd97fef6f18eef91bfed7d2057c39bd204702 Modif

pgsql: Fix role names in src/test/authentication/t/005_login_trigger.pl

2023-10-15 Thread Alexander Korotkov
Fix role names in src/test/authentication/t/005_login_trigger.pl Per buildfarm member longfin. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/47ab5d2e2ec762c9a07b4e07f0207b8230a489c1 Modified Files -- src/test/authentication/t/005_login_trigger.pl | 26

pgsql: Rename 005_login_trigger.pl to 006_login_trigger.pl

2023-10-15 Thread Alexander Korotkov
Rename 005_login_trigger.pl to 006_login_trigger.pl In order to avoid numbering collision with 005_sspi.pl. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1f89b73c4e053c463d75608c27ca564770fd3158 Modified Files -- src/test/authentication/t/{005_login_t

pgsql: Add support event triggers on authenticated login

2023-10-15 Thread Alexander Korotkov
Add support event triggers on authenticated login This commit introduces trigger on login event, allowing to fire some actions right on the user connection. This can be useful for logging or connection check purposes as well as for some personalization of environment. Usage details are described

pgsql: Fix another typo in e0b1ee17dc

2023-10-07 Thread Alexander Korotkov
Fix another typo in e0b1ee17dc Reported-by: Richard Guo Discussion: https://postgr.es/m/CAMbWs4_kHMJDak75y1kBTirv-drS1-knT-7Mpg5LprAjqRJDVA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/82a7132f531b8b12e77d17476e9bfd599c3c30cf Modified Files ---

pgsql: Fix typos in e0b1ee17dc

2023-10-07 Thread Alexander Korotkov
Fix typos in e0b1ee17dc Reported-by: Alexander Lakhin Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e8c334c47abb6c8f648cb50241c2cd65c9e4e6dc Modified Files -- src/backend/access/nbtree/nbtsearch.c | 2 +- src/backend/access/nbtree/nbtutils.c | 2 +- 2

pgsql: Skip checking of scan keys required for directional scan in B-tr

2023-10-06 Thread Alexander Korotkov
Skip checking of scan keys required for directional scan in B-tree Currently, B-tree code matches every scan key to every item on the page. Imagine the ordered B-tree scan for the query like this. SELECT * FROM tbl WHERE col > 'a' AND col < 'b' ORDER BY col; The (col > 'a') scan key will be alwa

pgsql: Revert "Add USER SET parameter values for pg_db_role_setting"

2023-05-17 Thread Alexander Korotkov
Revert "Add USER SET parameter values for pg_db_role_setting" This reverts commit 096dd80f3ccc and its fixups beecbe8e5001, afdd9f7f0e00, 529da086ba, db93e739ac61. Catversion is bumped. Discussion: https://postgr.es/m/d46f9265-ff3c-6743-2278-6772598233c2%40pgmasters.net Branch -- master D

pgsql: Fix wrong construct_array_builtin() call in GUCArrayDelete()

2023-04-27 Thread Alexander Korotkov
Fix wrong construct_array_builtin() call in GUCArrayDelete() The current code unintentionally uses the wrong datum to construct an array. The bug was introduced by 096dd80f3c, so no backpatching is needed. Reported-by: David Steele Discussion: https://postgr.es/m/d46f9265-ff3c-6743-2278-67725982

pgsql: Validate ltree siglen GiST option to be int-aligned

2023-04-23 Thread Alexander Korotkov
Validate ltree siglen GiST option to be int-aligned Unaligned siglen could lead to an unaligned access to subsequent key fields. Backpatch to 13, where opclass options were introduced. Reported-by: Alexander Lakhin Bug: 17847 Discussion: https://postgr.es/m/17847-171232970bea406b%40postgresql.o

pgsql: Fix custom validators call in build_local_reloptions()

2023-04-23 Thread Alexander Korotkov
Fix custom validators call in build_local_reloptions() We need to call them only when validate == true. Backpatch to 13, where opclass options were introduced. Reported-by: Tom Lane Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us Reviewed-by: Tom Lane, Pavel Borisov Backpatch-

pgsql: Validate ltree siglen GiST option to be int-aligned

2023-04-23 Thread Alexander Korotkov
Validate ltree siglen GiST option to be int-aligned Unaligned siglen could lead to an unaligned access to subsequent key fields. Backpatch to 13, where opclass options were introduced. Reported-by: Alexander Lakhin Bug: 17847 Discussion: https://postgr.es/m/17847-171232970bea406b%40postgresql.or

pgsql: Fix custom validators call in build_local_reloptions()

2023-04-23 Thread Alexander Korotkov
Fix custom validators call in build_local_reloptions() We need to call them only when validate == true. Backpatch to 13, where opclass options were introduced. Reported-by: Tom Lane Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us Reviewed-by: Tom Lane, Pavel Borisov Backpatch-

pgsql: Fix custom validators call in build_local_reloptions()

2023-04-23 Thread Alexander Korotkov
Fix custom validators call in build_local_reloptions() We need to call them only when validate == true. Backpatch to 13, where opclass options were introduced. Reported-by: Tom Lane Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us Reviewed-by: Tom Lane, Pavel Borisov Backpatch-

pgsql: Validate ltree siglen GiST option to be int-aligned

2023-04-23 Thread Alexander Korotkov
Validate ltree siglen GiST option to be int-aligned Unaligned siglen could lead to an unaligned access to subsequent key fields. Backpatch to 13, where opclass options were introduced. Reported-by: Alexander Lakhin Bug: 17847 Discussion: https://postgr.es/m/17847-171232970bea406b%40postgresql.or

pgsql: Fix custom validators call in build_local_reloptions()

2023-04-23 Thread Alexander Korotkov
Fix custom validators call in build_local_reloptions() We need to call them only when validate == true. Backpatch to 13, where opclass options were introduced. Reported-by: Tom Lane Discussion: https://postgr.es/m/2656633.1681831542%40sss.pgh.pa.us Reviewed-by: Tom Lane, Pavel Borisov Backpatch-

pgsql: Validate ltree siglen GiST option to be int-aligned

2023-04-23 Thread Alexander Korotkov
Validate ltree siglen GiST option to be int-aligned Unaligned siglen could lead to an unaligned access to subsequent key fields. Backpatch to 13, where opclass options were introduced. Reported-by: Alexander Lakhin Bug: 17847 Discussion: https://postgr.es/m/17847-171232970bea406b%40postgresql.or

Re: pgsql: psql: add an optional execution-count limit to \watch.

2023-04-07 Thread Alexander Korotkov
On Fri, Apr 7, 2023 at 5:00 PM Tom Lane wrote: > Alexander Korotkov writes: > > On Thu, Apr 6, 2023 at 8:18 PM Tom Lane wrote: > >> psql: add an optional execution-count limit to \watch. > > > This commit makes tests fail for me. psql parses 'i' option of &

Re: pgsql: psql: add an optional execution-count limit to \watch.

2023-04-07 Thread Alexander Korotkov
re strtod(), but 001_basic.pl uses hard-coded decimal separator. The proposed fix is attached. -- Regards, Alexander Korotkov psql_test_fix.patch Description: Binary data

pgsql: Revert 11470f544e

2023-04-03 Thread Alexander Korotkov
Revert 11470f544e Discussion: https://postgr.es/m/20230323003003.plgaxjqahjgkuxrk%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2b65bf046d8a23be25502638da77a1592da2548d Modified Files -- src/backend/access/heap/heapam_handler.c |

pgsql: Revert 764da7710b

2023-04-03 Thread Alexander Korotkov
Revert 764da7710b Discussion: https://postgr.es/m/20230323003003.plgaxjqahjgkuxrk%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b0b91ced167f02ced4adaf1b2ecdc6fa0f6eb6e9 Modified Files -- src/backend/executor/nodeModifyTable.c | 4

pgsql: Evade extra table_tuple_fetch_row_version() in ExecUpdate()/Exec

2023-03-22 Thread Alexander Korotkov
Evade extra table_tuple_fetch_row_version() in ExecUpdate()/ExecDelete() When we lock tuple using table_tuple_lock() then we at the same time fetch the locked tuple to the slot. In this case we can skip extra table_tuple_fetch_row_version() thank to we've already fetched the 'old' tuple and nobod

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

2023-03-22 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 concurrent transaction. 1. Attempt to update/delete tuple wi

pgsql: Fix jsonpath existense checking of missing variables

2023-01-12 Thread Alexander Korotkov
qDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com Author: Alexander Korotkov, David G. Johnston Backpatch-through: 12 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3161ae86ce3ced0a91c2d3cdbbdc602d6e19892d Modified Files -- src/backend/utils/adt/jsonpath_e

pgsql: Fix jsonpath existense checking of missing variables

2023-01-12 Thread Alexander Korotkov
qDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com Author: Alexander Korotkov, David G. Johnston Backpatch-through: 12 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/2ff3ac3b5f52a54b829cc7275141839581b568de Modified Files -- src/backend/util

pgsql: Fix jsonpath existense checking of missing variables

2023-01-12 Thread Alexander Korotkov
qDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com Author: Alexander Korotkov, David G. Johnston Backpatch-through: 12 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4dc3f94fae3de3f19b5c7dd507beac0216b0cde9 Modified Files -- src/backend/util

pgsql: Fix jsonpath existense checking of missing variables

2023-01-12 Thread Alexander Korotkov
qDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com Author: Alexander Korotkov, David G. Johnston Backpatch-through: 12 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0d9221f1d251b956a33660bff1420140f8abebcb Modified Files -- src/backend/util

pgsql: Fix jsonpath existense checking of missing variables

2023-01-12 Thread Alexander Korotkov
qDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com Author: Alexander Korotkov, David G. Johnston Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/9e24e4781750ca92a0a5ff0aaa8e2091785c3bed Modified Files -- src/backend/util

pgsql: Improve GIN cost estimation

2023-01-08 Thread Alexander Korotkov
ion: https://postgr.es/m/3188617.44csPzL39Z%40aivenronan Author: Ronan Dunklau Reported-By: Hung Nguyen Reviewed-by: Tom Lane, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cd9479af2af25d7fa9bfd24dd4dcf976b360f077 Modified Files -- src/backend

pgsql: Extract the multiplier for CPU process cost of index page into a

2023-01-08 Thread Alexander Korotkov
Extract the multiplier for CPU process cost of index page into a macro B-tree, GiST and SP-GiST all charge 50.0 * cpu_operator_cost for processing an index page. Extract this to a macro to avoid repeated magic numbers. Discussion: https://mail.google.com/mail/u/0/?ik=a20b091faa&view=om&permmsgi

pgsql: meson: Add 'running' test setup, as a replacement for installche

2023-01-05 Thread Alexander Korotkov
meson: Add 'running' test setup, as a replacement for installcheck Do the same as 3f0e786ccbf5 for test_pg_db_role_setting. Discussion: https://postgr.es/m/20221227065456.gu1...@telsasoft.com Author: Pavel Borisov Reviewed-by: Justin Pryzby, Tom Lane Branch -- master Details --- https:/

pgsql: Remove extra regress check arguments from test_pg_db_role_settin

2023-01-05 Thread Alexander Korotkov
Remove extra regress check arguments from test_pg_db_role_setting They were accidentally copied from test_oat_hooks. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20230102154240.GL1153%40telsasoft.com Reviewed-by: Pavel Borisov Branch -- master Details --- https://git.postg

pgsql: Fix invalid role names introduced in 096dd80f3c

2022-12-09 Thread Alexander Korotkov
Fix invalid role names introduced in 096dd80f3c 096dd80f3c added new regression tests dealing with roles. By oversight, role names didn't start with regress_ prefix. This commit fixes that. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/beecbe8e5001249f0ad51f828d

Re: pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
On Fri, Dec 9, 2022 at 1:44 PM Alexander Korotkov wrote: > On Fri, Dec 9, 2022 at 1:22 PM Alexander Korotkov > wrote: > > Add USER SET parameter values for pg_db_role_setting > > I've seen buildfarm failures at sifaka and longfin and discovering them. I appears to be

Re: pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
On Fri, Dec 9, 2022 at 1:22 PM Alexander Korotkov wrote: > Add USER SET parameter values for pg_db_role_setting I've seen buildfarm failures at sifaka and longfin and discovering them. -- Regards, Alexander Korotkov

pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
l.com Author: Alexander Korotkov, Steve Chavez Reviewed-by: Pavel Borisov, Steve Chavez Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/096dd80f3ccc103c8e078fca05e6ccfb2071aa91 Modified Files -- doc/src/sgml/catalogs.sgml | 10 +

pgsql: Check the snapshot argument of index_beginscan and family

2022-12-05 Thread Alexander Korotkov
Check the snapshot argument of index_beginscan and family Passing a NULL snapshot (InvalidSnapshot) is going to work but only as long as the index can't find any matching rows. This can be confusing for the extension authors, so add an explicit check for this argument. The check is implemented w

pgsql: Support for custom slots in the custom executor nodes

2022-11-23 Thread Alexander Korotkov
benefit. Discussion: https://postgr.es/m/capphfdujuu6toecvtyre_yjxts80fyppct4ohalfk3oehem...@mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cee120951427fe39a54ab800abfa2834d85b8771 Modified

Re: pgsql: Move memory management away from writetup() and tuplesort_put*()

2022-08-27 Thread Alexander Korotkov
Hi, David! On Fri, Aug 26, 2022 at 3:53 AM David Rowley wrote: > > On Wed, 27 Jul 2022 at 17:29, Alexander Korotkov > wrote: > > src/backend/utils/sort/tuplesort.c | 78 > > -- > > I was wondering about the following com

pgsql: Fix typo in comment for writetuple() function

2022-08-27 Thread Alexander Korotkov
Fix typo in comment for writetuple() function Reported-by: David Rowley Discussion: https://postgr.es/m/CAApHDvrZ9Ky2LcWwcKsbdYChA850JE5qS%3DkGJiTNWS8mbBXZHw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/924954c670355f2a0ca1dd4173574a28fc0eedec

pgsql: Move memory management away from writetup() and tuplesort_put*()

2022-07-26 Thread Alexander Korotkov
tetup() doesn't need to free SortTuple.tuple and increase available memory. Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim Orlov, Matthias van de Meent Reviewed-by: Andres Freund, J

pgsql: Add new Tuplesortstate.removeabbrev function

2022-07-26 Thread Alexander Korotkov
ntial part of abbreviation handling code in tuplesort_put*() functions, making these functions similar. Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim Orlov, Matthias van de

pgsql: Put abbreviation logic into puttuple_common()

2022-07-26 Thread Alexander Korotkov
puttuple_common() function. Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim Orlov, Matthias van de Meent Reviewed-by: Andres Freund, John Naylor Branch -- master Details

pgsql: Split TuplesortPublic from Tuplesortstate

2022-07-26 Thread Alexander Korotkov
Tuplesortstate, that is without knowledge of generic sort implementation guts. Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim Orlov, Matthias van de Meent Reviewed-by: Andres Freund, John

pgsql: Remove Tuplesortstate.copytup function

2022-07-26 Thread Alexander Korotkov
() do their work. This commit removes Tuplesortstate.copytup() altogether, putting the corresponding code into tuplesort_put*(). Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim

pgsql: Split tuplesortvariants.c from tuplesort.c

2022-07-26 Thread Alexander Korotkov
. Discussion: https://postgr.es/m/CAPpHfdvjix0Ahx-H3Jp1M2R%2B_74P-zKnGGygx4OWr%3DbUQ8BNdw%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Pavel Borisov, Maxim Orlov, Matthias van de Meent Reviewed-by: Andres Freund, John Naylor Branch -- master Details --- https://git.postgresql.org/pg

pgsql: Document the ability to specify TableAM for pgbench

2022-07-20 Thread Alexander Korotkov
ay to specify TableAM for pgbench. Discussion: https://postgr.es/m/CAC77N6ih%3DLbhZQXV76grEsaVQkBL464Y2Foqq9o%3Df4UBfEOfEQ%40mail.gmail.com Author: Michel Pelletier, Alexander Korotkov Reviewed-by: Justin Pryzby, Mason Sharp, Michael Paquier Branch -- master Details --- https://git.postgresq

pgsql: Use C99 designator in the rbtree sentinel definition

2022-07-08 Thread Alexander Korotkov
Use C99 designator in the rbtree sentinel definition This change should improve the code readability. Discussion: https://postgr.es/m/CAGRrpzYE8-7GCoaPjOiL9T_HY605MRax-2jgTtLq236uksZ1Sw%40mail.gmail.com Author: Steve Chavez, Alexander Korotkov Reviewed-by: Alexander Korotkov Branch

pgsql: Add missing inequality searches to rbtree

2022-07-08 Thread Alexander Korotkov
implementing these searches. While these searches aren't yet used in the core code, they might be useful for extensions. Discussion: https://postgr.es/m/CAGRrpzYE8-7GCoaPjOiL9T_HY605MRax-2jgTtLq236uksZ1Sw%40mail.gmail.com Author: Steve Chavez, Alexander Korotkov Reviewed-by: Alexander Korotkov B

pgsql: Fix default signature length for gist_ltree_ops

2022-03-16 Thread Alexander Korotkov
indexes after the upgrade. Reported-by: Victor Yegorov Reviewed-by: Tomas Vondra, Tom Lane, Andres Freund, Nikita Glukhov Reviewed-by: Andrew Dunstan Author: Tomas Vondra, Alexander Korotkov Discussion: https://postgr.es/m/17406-71e02820ae79bb40%40postgresql.org Discussion: https://postgr.es/m

pgsql: Fix default signature length for gist_ltree_ops

2022-03-16 Thread Alexander Korotkov
indexes after the upgrade. Reported-by: Victor Yegorov Reviewed-by: Tomas Vondra, Tom Lane, Andres Freund, Nikita Glukhov Reviewed-by: Andrew Dunstan Author: Tomas Vondra, Alexander Korotkov Discussion: https://postgr.es/m/17406-71e02820ae79bb40%40postgresql.org Discussion: https://postgr.es/m

pgsql: Fix default signature length for gist_ltree_ops

2022-03-16 Thread Alexander Korotkov
indexes after the upgrade. Reported-by: Victor Yegorov Reviewed-by: Tomas Vondra, Tom Lane, Andres Freund, Nikita Glukhov Reviewed-by: Andrew Dunstan Author: Tomas Vondra, Alexander Korotkov Discussion: https://postgr.es/m/17406-71e02820ae79bb40%40postgresql.org Discussion: https://postgr.es/m

pgsql: Fix memory leak in IndexScan node with reordering

2022-02-13 Thread Alexander Korotkov
: Aliaksandr Kalenik Reviewed-by: Tom Lane, Alexander Korotkov Backpatch-through: 10 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c76665edce3d4db4e509723e91742569e9f46817 Modified Files -- src/backend/executor/nodeIndexscan.c | 6 +- src/test

pgsql: Fix memory leak in IndexScan node with reordering

2022-02-13 Thread Alexander Korotkov
: Aliaksandr Kalenik Reviewed-by: Tom Lane, Alexander Korotkov Backpatch-through: 10 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3f74daa8dfc634132ff7270212c57da5e316b001 Modified Files -- src/backend/executor/nodeIndexscan.c | 6 +- src/test/regress

pgsql: Fix memory leak in IndexScan node with reordering

2022-02-13 Thread Alexander Korotkov
: Aliaksandr Kalenik Reviewed-by: Tom Lane, Alexander Korotkov Backpatch-through: 10 Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0d554775bd040e8edff66a57289b3bd56f64c2f2 Modified Files -- src/backend/executor/nodeIndexscan.c | 6 +- src/test

<    1   2   3   4   5   6   7   8   >