Assert when executing query on partitioned table

2025-02-20 Thread Dmitry Koval
ng. --- I suggest replace Assert with an error message, see [v1-0001-draft-of-fix.patch]. This is not a final fix as I am confused by the comment for Assert: "we don't support an UPDATE of INSERT ON CONFLICT for a partitioned table". (Why "don't support an UPDATE"?

Assignment before assert

2025-02-13 Thread Dmitry Koval
Hi! Function EvalPlanQualFetchRowMark contains an assignment ExecRowMark *erm = earm->rowmark; before assert Assert(earm != NULL); Maybe these lines need to be swapped? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com diff --git a/src/back

Re: Invalid index on partitioned table - is this a bug or feature?

2025-01-22 Thread Dmitry Koval
22.01.2025 20:57, Álvaro Herrera пишет: Yes. You need to attach child indexes on all partitions so that this index becomes valid. Thanks! -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Invalid index on partitioned table - is this a bug or feature?

2025-01-22 Thread Dmitry Koval
eyIndex() returns InvalidOid for INVALID PK. Is this a bug or a feature? Should this be corrected? Links. [1] https://github.com/postgres/postgres/blob/master/src/backend/commands/indexcmds.c#L1211 -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: gamma() and lgamma() functions

2024-11-14 Thread Dmitry Koval
ut of range: overflow >SELECT gamma(float8 '0'); gamma -- Infinity (1 row) Perhaps it would be logical if the behavior in these cases was the same (either ERROR or 'Infinity')? Links: [1] https://stackoverflow.com/questions/58884066/how-can-i-run-the-equiva

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-08-10 Thread Dmitry Koval
. (Excuse me, I won't have access to a laptop for the next week - and won't be able to look at the source code). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-08-09 Thread Dmitry Koval
newly created partition from the ProcessUtility() function... Maybe it would be enough to check that the new partition is located in the namespace in which we created it (see attachment)? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comdiff --git a/src/backend/com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-13 Thread Dmitry Koval
ice regress_partition_merge_bob -> regress_partition_split_bob (changes in attachment) -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom f307add79397bcfe20f7c779e77630fb0df73020 Mon Sep 17 00:00:00 2001 From: Koval Dmitry Date: Mon, 13 May 2024 12:32:43 +0300 Subject: [PATCH v1]

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-12 Thread Dmitry Koval
Hi! Attached draft version of fix for [1]. [1] https://www.postgresql.org/message-id/86b4f1e3-0b5d-315c-9225-19860d64d685%40gmail.com -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom ece01564aeb848bab2a61617412a1d175e45b934 Mon Sep 17 00:00:00 2001 From

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-11 Thread Dmitry Koval
) ; -- ERROR: relation "tp_0" already exists ALTER TABLE t SPLIT PARTITION tp_0 INTO (PARTITION tp_0 FOR VALUES FROM (0) TO (1), PARTITION tp_1 FOR VALUES FROM (1) TO (2)); I'll try to fix it soon. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-01 Thread Dmitry Koval
ommit/fcf80c5d5f0f3787e70fca8fd029d2e08a923f91 -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-30 Thread Dmitry Koval
blob/d12b4ba1bd3eedd862064cf1dad5ff107c5cba90/src/backend/commands/tablecmds.c#L21215 -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Dmitry Koval
ition is immediately created with the correct name (the old partition is renamed). 2. Just in case, I am attaching a small fix v9_fix.diff for situation [1]. [1] https://www.postgresql.org/message-id/0520c72e-8d97-245e-53f9-173beca2ab2e%40gmail.com -- With best regards, Dmitry Koval Postgre

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Dmitry Koval
this case. The patch should be applied after patches v6-0001- ... .patch ... v6-0004- ... .patch -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom 58e4b7fb1d3b15cdf1c742c28690392dda34915d Mon Sep 17 00:00:00 2001 From: Koval Dmitry Date: Fri, 19 Apr 2024 01:57:49

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-15 Thread Dmitry Koval
chema explicitly). The rest of the changes in v6_afterfix.diff are not very important and can be ignored. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comdiff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index c6ce7b94d9..bce5e39b64

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-12 Thread Dmitry Koval
Thanks, Alexander! Still now we're able to create a partition in the pg_temp schema explicitly. Attached patches with fix. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom 2b68bbdb068e881e8ca6e34dec735f7ce656374f Mon Sep 17 00:00:00 2001 From:

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-12 Thread Dmitry Koval
whatever. In next releases I want to allow specifying options (probably, first of all, specifying tablespace of the partitions). But before that, I would like to get a users reaction - what options they really need? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespr

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Dmitry Koval
PLIT-MERGE-partitions-of-temporary-table.patch. 2. >It seems to me that v2-0001-Fix-for-SPLIT-MERGE-partitions-of- >temporary-table.patch is not complete either. Added correction (and test), see v3-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch. -- With bes

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Dmitry Koval
-text.patch. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom cfd5a56d15e7ead6dd7ae66cd382de3fa38150d7 Mon Sep 17 00:00:00 2001 From: Koval Dmitry Date: Wed, 10 Apr 2024 18:54:05 +0300 Subject: [PATCH v2 1/2] Fix for SPLIT/MERGE partitions of temporary table --- src

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-10 Thread Dmitry Koval
-text.patch - fixes for English text (comments, error messages etc.). Links: [1] https://www.postgresql.org/message-id/dbc8b96c-3cf0-d1ee-860d-0e491da20485%40gmail.com -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom 3c443a57c334c74e9218fd4e2f1ced45e6d4141d Mon

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-08 Thread Dmitry Koval
Hi! Attached fix for the problems found by Alexander Lakhin. About grammar errors. Unfortunately, I don't know English well. Therefore, I plan (in the coming days) to show the text to specialists who perform technical translation of documentation. -- With best regards, Dmitry Koval Pos

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-07 Thread Dmitry Koval
Alexander Lakhin, thanks for the problems you found! Unfortunately I can't watch them immediately (event [1]). I will try to start solving them in 12-14 hours. [1] https://pgconf.ru/2024 -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-06 Thread Dmitry Koval
Hi, Alexander! I didn't push 0003 for the following reasons. Thanks for clarifying. You are right, these are serious reasons. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-27 Thread Dmitry Koval
038c49 [2] https://www.postgresql.org/message-id/171085360143.2046436.7217841141682511557.pgcf%40coridan.postgresql.org -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-19 Thread Dmitry Koval
Hi! The following review has been posted through the commitfest application: make installcheck-world: tested, passed Thanks for info! I was unable to reproduce the problem and I wanted to ask for clarification. But your message was ahead of my question. -- With best regards, Dmitry Koval

Re: collect_corrupt_items_vacuum.patch

2024-01-13 Thread Dmitry Koval
Hi! Thank you, there is one small point left (in the comment): can you replace "guarantteed to be to be newer" to "guaranteed to be newer", file src/backend/storage/ipc/procarray.c? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: collect_corrupt_items_vacuum.patch

2023-12-05 Thread Dmitry Koval
/src/backend/storage/ipc/procarray.c#L1812 -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Operation log for major operations

2023-03-13 Thread Dmitry Koval
pg_resetwal, pg_rewind, pg_upgrade (these utilities also modify the pg_control file without the operation log). If you are interested, I can attach the current patch (for info - I think it makes no sense to offer this patch at commitfest). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Operation log for major operations

2023-03-02 Thread Dmitry Koval
ormation about "history" (about reason to use pg_control file as "history" storage, but write into it from position 4kB, 8kB,...). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Operation log for major operations

2023-03-02 Thread Dmitry Koval
Hi! These changes did not interest the community. It was expected (topic is very specifiс: vendor's technical support). So no sense to distract developers ... I'll move patch to Withdrawn. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Operation log for major operations

2023-01-25 Thread Dmitry Koval
cover all the uses of XX_file_exists functions. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Operation log for major operations

2023-01-20 Thread Dmitry Koval
jit.c:file_exists() (with adaptation for the utility). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom aabff7fa8e51e760c558efa7b53fb675f996c7ff Mon Sep 17 00:00:00 2001 From: Koval Dmitry Date: Mon, 14 Nov 2022 21:39:14 +0300 Subject: [PATCH v5] Operation log --- s

Re: Operation log for major operations

2023-01-19 Thread Dmitry Koval
>The patch does not apply on top of HEAD ... Thanks! Here is a fixed version. Additional changes: 1) get_operation_log() function doesn't create empty operation log file; 2) removed extra unlink() call. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro

Re: Operation log for major operations

2023-01-14 Thread Dmitry Koval
d cluster does not have 'pg_control_log' file. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom 69faac5e9fc11d17d641a0cff3b26806c2930e3f Mon Sep 17 00:00:00 2001 From: Koval Dmitry Date: Mon, 14 Nov 2022 21:39:14 +0300 Subject: [PATCH v3] Opera

Re: Operation log for major operations

2022-12-05 Thread Dmitry Koval
27; (if the name is not pretty, it can be changed). I attached the patch (v2-0001-Operation-log.patch) and description of operation log (Operation-log.txt). With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com- Introduction. - Operation

Re: Operation log for major operations

2022-11-21 Thread Dmitry Koval
this is more usable for RDBMS; * number of registered event types can be increased easy (without changes of storage). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Operation log for major operations

2022-11-21 Thread Dmitry Koval
and utilities to support this file. I attached the patch (v1-0001-Operation-log.patch) and extended description of operation log (Operation-log.txt). With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com- Operation log structures.

Re: Frontend error logging style

2022-10-11 Thread Dmitry Koval
markings broadly.) Is it correct? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-19 Thread Dmitry Koval
"relation does not exist" at end of operation (because split partition will be drop). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-08 Thread Dmitry Koval
Thanks for your advice, Justin and Alvaro! I'll try to reduce the size of this patch and split it into separate parts (for MERGE and SPLIT). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.

2022-09-07 Thread Dmitry Koval
the other three tests). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.comFrom 93a10abd0afb14b264e4cf59f7e92f619dd9b11a Mon Sep 17 00:00:00 2001 From: Pavel Borisov Date: Wed, 11 May 2022 15:54:13 +0400 Subject: [PATCH v15] Add option for amcheck and pg_amcheck to ch

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-07-15 Thread Dmitry Koval
This is not a review, but I think the isolation tests should be expanded. At least, include the case of serializable transactions being involved. Thanks! I will expand the tests for the next commitfest. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: enable/disable broken for statement triggers on partitioned tables

2022-07-14 Thread Dmitry Koval
I agree that the patch shouldn't have changed that behavior, so I've fixed the patch so that EnableDisableTrigger() recurses even if the parent trigger is unchanged. Thanks, I think this patch is ready for committer. -- With best regards, Dmitry Koval Postgres Professi

Re: enable/disable broken for statement triggers on partitioned tables

2022-07-07 Thread Dmitry Koval
ABLE DROP FUNCTION The patch doesn't start recursion in case 'tgenabled' flag of parent table is not changes. Probably vanilla result is more correct. -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-05-31 Thread Dmitry Koval
with partitions that are splitting/merging at this time should receive an error (like "Partition data is moving. Repeat the operation later") because old partitions will be deleted at the end of SPLIT/MERGE operation. I hope exists a better solution, but I don't know it now... -- With

Re: WIN32 pg_import_system_collations

2022-01-24 Thread Dmitry Koval
Hi Juan José, I a bit tested this feature and have small doubts about block: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) +*hyphen = '_'; After this bl

Re: WIN32 pg_import_system_collations

2022-01-24 Thread Dmitry Koval
Hi Juan José, I a bit tested this feature and have small doubts about block: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) +*hyphen = '_'; After this bl