Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-17 Thread Alexander Korotkov
Hi, Pavel! On Fri, May 17, 2024 at 2:02 PM Pavel Borisov wrote: > On Fri, 17 May 2024 at 14:05, Alexander Korotkov wrote: >> >> On Tue, May 14, 2024 at 5:49 PM Justin Pryzby wrote: >> > On Thu, May 09, 2024 at 12:51:32AM +0300, Alexander Korotkov wrote: >> > > > > However, parent's table

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-17 Thread Pavel Borisov
Hi, Alexander: On Fri, 17 May 2024 at 14:05, Alexander Korotkov wrote: > On Tue, May 14, 2024 at 5:49 PM Justin Pryzby > wrote: > > On Thu, May 09, 2024 at 12:51:32AM +0300, Alexander Korotkov wrote: > > > > > However, parent's table extended statistics already covers all its > > > > >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-17 Thread Alexander Korotkov
On Tue, May 14, 2024 at 5:49 PM Justin Pryzby wrote: > On Thu, May 09, 2024 at 12:51:32AM +0300, Alexander Korotkov wrote: > > > > However, parent's table extended statistics already covers all its > > > > children. > > > > > > => That's the wrong explanation. It's not that "stats on the parent

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-14 Thread Justin Pryzby
On Thu, May 09, 2024 at 12:51:32AM +0300, Alexander Korotkov wrote: > > > However, parent's table extended statistics already covers all its > > > children. > > > > => That's the wrong explanation. It's not that "stats on the parent > > table cover its children". It's that there are two types of

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-13 Thread Alexander Korotkov
On Mon, May 13, 2024 at 12:45 PM Dmitry Koval wrote: > 13.05.2024 11:45, Daniel Gustafsson пишет: > > Commit 3ca43dbbb67f which adds the permission checks seems to cause > > conflicts > > in the pg_upgrade tests > > Thanks! > > It will probably be enough to rename the roles: > >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-13 Thread Dmitry Koval
Hi! 13.05.2024 11:45, Daniel Gustafsson пишет: Commit 3ca43dbbb67f which adds the permission checks seems to cause conflicts in the pg_upgrade tests Thanks! It will probably be enough to rename the roles: regress_partition_merge_alice -> regress_partition_split_alice

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-13 Thread Daniel Gustafsson
Commit 3ca43dbbb67f which adds the permission checks seems to cause conflicts in the pg_upgrade tests: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=piculet=2024-05-13%2008%3A36%3A37 There is an issue with dropping and creating roles which seems to stem from this commit: CREATE ROLE

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
Hi! 11.05.2024 12:00, Alexander Lakhin wrote: Please look at one more anomaly with temporary tables: Thank you, Alexander! The problem affects the SPLIT PARTITION command. CREATE TEMP TABLE t (a int) PARTITION BY RANGE (a); CREATE TEMP TABLE tp_0 PARTITION OF t FOR VALUES FROM (0) TO (2) ;

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-11 Thread Alexander Lakhin
Hello Dmitry and Alexander, Please look at one more anomaly with temporary tables: CREATE TEMP TABLE t (a int) PARTITION BY RANGE (a); CREATE TEMP TABLE tp_0 PARTITION OF t FOR VALUES FROM (0) TO (1) ; CREATE TEMP TABLE tp_1 PARTITION OF t FOR VALUES FROM (1) TO (2); ALTER TABLE t MERGE

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-08 Thread Alexander Korotkov
On Thu, May 9, 2024 at 12:37 AM Justin Pryzby wrote: > > On Wed, May 08, 2024 at 09:00:10PM +0300, Alexander Korotkov wrote: > > On Fri, May 3, 2024 at 4:32 PM Alexander Korotkov > > wrote: > > > On Fri, May 3, 2024 at 4:23 PM Justin Pryzby wrote: > > > > On Wed, May 01, 2024 at 10:51:24PM

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-08 Thread Justin Pryzby
On Wed, May 08, 2024 at 09:00:10PM +0300, Alexander Korotkov wrote: > On Fri, May 3, 2024 at 4:32 PM Alexander Korotkov > wrote: > > On Fri, May 3, 2024 at 4:23 PM Justin Pryzby wrote: > > > On Wed, May 01, 2024 at 10:51:24PM +0300, Dmitry Koval wrote: > > > > 30.04.2024 23:15, Justin Pryzby

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-08 Thread Alexander Korotkov
On Wed, May 1, 2024 at 12:14 AM Dmitry Koval wrote: > 30.04.2024 6:00, Alexander Lakhin пишет: > > Maybe I'm doing something wrong, but the following script: > > CREATE TABLE t (i int, PRIMARY KEY(i)) PARTITION BY RANGE (i); > > CREATE TABLE tp_0 PARTITION OF t FOR VALUES FROM (0) TO (1); > >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-08 Thread Alexander Korotkov
On Fri, May 3, 2024 at 4:32 PM Alexander Korotkov wrote: > On Fri, May 3, 2024 at 4:23 PM Justin Pryzby wrote: > > On Wed, May 01, 2024 at 10:51:24PM +0300, Dmitry Koval wrote: > > > 30.04.2024 23:15, Justin Pryzby пишет: > > > > Is this issue already fixed ? > > > > I wasn't able to reproduce

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-03 Thread Alexander Korotkov
On Fri, May 3, 2024 at 4:23 PM Justin Pryzby wrote: > On Wed, May 01, 2024 at 10:51:24PM +0300, Dmitry Koval wrote: > > 30.04.2024 23:15, Justin Pryzby пишет: > > > Is this issue already fixed ? > > > I wasn't able to reproduce it. Maybe it only happened with earlier > > > patch versions applied

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-03 Thread Justin Pryzby
On Wed, May 01, 2024 at 10:51:24PM +0300, Dmitry Koval wrote: > Hi! > > 30.04.2024 23:15, Justin Pryzby пишет: > > Is this issue already fixed ? > > I wasn't able to reproduce it. Maybe it only happened with earlier > > patch versions applied ? > > I think this was fixed in commit [1]. > > [1]

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-01 Thread Dmitry Koval
Hi! 30.04.2024 23:15, Justin Pryzby пишет: Is this issue already fixed ? I wasn't able to reproduce it. Maybe it only happened with earlier patch versions applied ? I think this was fixed in commit [1]. [1]

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-30 Thread Dmitry Koval
Hi! 30.04.2024 6:00, Alexander Lakhin пишет: Maybe I'm doing something wrong, but the following script: CREATE TABLE t (i int, PRIMARY KEY(i)) PARTITION BY RANGE (i); CREATE TABLE tp_0 PARTITION OF t FOR VALUES FROM (0) TO (1); CREATE TABLE tp_1 PARTITION OF t FOR VALUES FROM (1) TO (2);

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-30 Thread Justin Pryzby
On Thu, Apr 11, 2024 at 08:00:00PM +0300, Alexander Lakhin wrote: > 11.04.2024 16:27, Dmitry Koval wrote: > > > > Added correction (and test), see > > v3-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch. > > Thank you for the correction, but may be an attempt to merge into implicit

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Alexander Lakhin
30.04.2024 03:10, Dmitry Koval wrote: Hi! 1. 29.04.2024 21:00, Alexander Lakhin wrote: I still wonder, why that constraint (now with a less questionable name) is created during MERGE? The SPLIT/MERGE PARTITION(S) commands for creating partitions reuse the existing code of CREATE TABLE ..

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Dmitry Koval
Hi! 1. 29.04.2024 21:00, Alexander Lakhin wrote: I still wonder, why that constraint (now with a less questionable name) is created during MERGE? The SPLIT/MERGE PARTITION(S) commands for creating partitions reuse the existing code of CREATE TABLE .. LIKE ... command. A new partition was

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-29 Thread Alexander Lakhin
Hi Dmitry, 19.04.2024 02:26, Dmitry Koval wrote: 18.04.2024 19:00, Alexander Lakhin wrote: leaves a strange constraint: \d+ t*    Table "public.tp_0" ... Not-null constraints: "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i" Thanks! Attached fix

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Justin Pryzby
On Sun, Apr 28, 2024 at 08:18:42AM -0500, Justin Pryzby wrote: > > I will explore this. Do we copy extended stats when we do CREATE > > TABLE ... PARTITION OF? I think we need to do the same here. > > Right, they're not copied because an extended stats objs on the parent > does something

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, Alexander Lakhin wrote: > > When we deal with mixed ownership, say, bob is an owner of a > partitioned table, but not an owner of a partition, should we > allow him to perform merge with that partition? > > Attaching via alter table requires the user to own both the

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, Alexander Lakhin wrote: > > When we deal with mixed ownership, say, bob is an owner of a > partitioned table, but not an owner of a partition, should we > allow him to perform merge with that partition? > > IIUC Merge causes the source tables to be dropped, their data

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Justin Pryzby
On Sun, Apr 28, 2024 at 04:04:54AM +0300, Alexander Korotkov wrote: > Hi Justin, > > Thank you for your review. Please check v9 of the patchset [1]. > > On Wed, Apr 24, 2024 at 11:26 PM Justin Pryzby wrote: > > This patch also/already fixes the schema issue I reported. Thanks. > > > > If you

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Alexander Korotkov
On Sun, Apr 28, 2024 at 2:00 PM Alexander Lakhin wrote: > 28.04.2024 03:59, Alexander Korotkov wrote: > > The revised patchset is attached. I'm going to push it if there are > > no objections. > > I have one additional question regarding security, if you don't mind: > What permissions should a

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Alexander Lakhin
Hello, 28.04.2024 03:59, Alexander Korotkov wrote: The revised patchset is attached. I'm going to push it if there are no objections. I have one additional question regarding security, if you don't mind: What permissions should a user have to perform split/merge? When we deal with mixed

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-27 Thread Alexander Korotkov
Hi Justin, Thank you for your review. Please check v9 of the patchset [1]. On Wed, Apr 24, 2024 at 11:26 PM Justin Pryzby wrote: > This patch also/already fixes the schema issue I reported. Thanks. > > If you wanted to include a test case for that: > > begin; > CREATE SCHEMA s; > CREATE

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-26 Thread Pavel Borisov
Hi, Hackers! On Thu, 25 Apr 2024 at 00:26, Justin Pryzby wrote: > On Mon, Apr 22, 2024 at 01:31:48PM +0300, Alexander Korotkov wrote: > > Hi! > > > > On Fri, Apr 19, 2024 at 4:29 PM Alexander Korotkov > wrote: > > > On Fri, Apr 19, 2024 at 2:26 AM Dmitry Koval > wrote: > > > > 18.04.2024

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-24 Thread Justin Pryzby
On Mon, Apr 22, 2024 at 01:31:48PM +0300, Alexander Korotkov wrote: > Hi! > > On Fri, Apr 19, 2024 at 4:29 PM Alexander Korotkov > wrote: > > On Fri, Apr 19, 2024 at 2:26 AM Dmitry Koval wrote: > > > 18.04.2024 19:00, Alexander Lakhin wrote: > > > > leaves a strange constraint: > > > > \d+ t*

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-19 Thread Justin Pryzby
On Thu, Apr 11, 2024 at 10:20:53PM -0400, Robert Haas wrote: > On Thu, Apr 11, 2024 at 9:54 PM Alexander Korotkov > wrote: > > I think we shouldn't unconditionally copy schema name and > > relpersistence from the parent table. Instead we should throw the > > error on a mismatch like CREATE

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-19 Thread Alexander Lakhin
18.04.2024 20:49, Alvaro Herrera wrote: On 2024-Apr-18, Alexander Lakhin wrote: I think the feature implementation should also provide tab completion for SPLIT/MERGE. I don't think that we should be imposing on feature authors or committers the task of filling in tab-completion for whatever

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Dmitry Koval
Hi! 18.04.2024 19:00, Alexander Lakhin wrote: leaves a strange constraint: \d+ t*   Table "public.tp_0" ... Not-null constraints:     "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i" Thanks! Attached fix (with test) for this case. The patch should be

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Justin Pryzby
Here are some additional fixes to docs. >From 6da8beaa5a2b78e785e5b6519894f8357002d916 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 18 Apr 2024 15:40:44 -0500 Subject: [PATCH] doc review for ALTER TABLE ... SPLIT/MERGE PARTITION --- doc/src/sgml/ddl.sgml | 4 ++--

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Robert Haas
On Thu, Apr 18, 2024 at 6:35 AM Alexander Korotkov wrote: > The revised patchset is attached. > 1) I've split the fix for the CommandCounterIncrement() issue and the > fix for relation persistence issue into a separate patch. > 2) I've validated that the lock on the new partition is held in >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Alvaro Herrera
On 2024-Apr-18, Alexander Lakhin wrote: > I think the feature implementation should also provide tab completion > for SPLIT/MERGE. I don't think that we should be imposing on feature authors or committers the task of filling in tab-completion for whatever features they contribute. I mean, if

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Dagfinn Ilmari Mannsåker
Alexander Lakhin writes: > Hi Alexander, > > 18.04.2024 13:35, Alexander Korotkov wrote: >> >> The revised patchset is attached. >> 1) I've split the fix for the CommandCounterIncrement() issue and the >> fix for relation persistence issue into a separate patch. >> 2) I've validated that the

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Alexander Lakhin
Hi Alexander, 18.04.2024 13:35, Alexander Korotkov wrote: The revised patchset is attached. 1) I've split the fix for the CommandCounterIncrement() issue and the fix for relation persistence issue into a separate patch. 2) I've validated that the lock on the new partition is held in

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-18 Thread Alexander Korotkov
Hi, Dmitry! On Mon, Apr 15, 2024 at 6:26 PM Dmitry Koval wrote: > > Hi! > > > Please, find a my version of this fix attached. > > Is it possible to make a small addition to the file v6-0001 ... .patch > (see attachment)? > > Most important: > 1) Line 19: > > + mergePartName =

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-15 Thread Robert Haas
On Mon, Apr 15, 2024 at 11:00 AM Alexander Lakhin wrote: > Initially I was confused by that message, because of: > CREATE TABLE t (i int) PARTITION BY RANGE (i); > CREATE FOREIGN TABLE ftp_0_1 PARTITION OF t >FOR VALUES FROM (0) TO (1) >SERVER loopback OPTIONS (table_name 'lt_0_1'); >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-15 Thread Dmitry Koval
Hi! Please, find a my version of this fix attached. Is it possible to make a small addition to the file v6-0001 ... .patch (see attachment)? Most important: 1) Line 19: + mergePartName = makeRangeVar(cmd->name->schemaname, tmpRelName, -1); (temporary table should use the same schema as

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-15 Thread Alexander Lakhin
Hello Robert, 15.04.2024 17:30, Robert Haas wrote: On Sat, Apr 13, 2024 at 6:05 AM Alexander Korotkov wrote: Please, find a my version of this fix attached. I think we need to check relpersistence in a similar way ATTACH PARTITION or CREATE TABLE ... PARTITION OF do. I'm going to polish

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-15 Thread Robert Haas
On Sat, Apr 13, 2024 at 6:05 AM Alexander Korotkov wrote: > Please, find a my version of this fix attached. I think we need to > check relpersistence in a similar way ATTACH PARTITION or CREATE TABLE > ... PARTITION OF do. I'm going to polish this a little bit more. + errmsg("\"%s\" is not an

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-13 Thread Alexander Korotkov
Hi, Dmitry! On Fri, Apr 12, 2024 at 10:59 PM Dmitry Koval wrote: > > Thanks, Alexander! > > > Still now we're able to create a partition in the pg_temp schema > > explicitly. > > Attached patches with fix. Please, find a my version of this fix attached. I think we need to check relpersistence

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: Koval

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-12 Thread Alexander Lakhin
Hi Dmitry, 12.04.2024 16:04, Dmitry Koval wrote: Hi! Attached is a patch with corrections based on comments in previous letters (I think these corrections are not final). I'll be very grateful for feedbacks and bug reports. 11.04.2024 20:00, Alexander Lakhin wrote: > may be an attempt to

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-12 Thread Dmitry Koval
Hi! Attached is a patch with corrections based on comments in previous letters (I think these corrections are not final). I'll be very grateful for feedbacks and bug reports. 11.04.2024 20:00, Alexander Lakhin wrote: > may be an attempt to merge into implicit > pg_temp should fail just like

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Robert Haas
On Thu, Apr 11, 2024 at 9:54 PM Alexander Korotkov wrote: > I think we shouldn't unconditionally copy schema name and > relpersistence from the parent table. Instead we should throw the > error on a mismatch like CREATE TABLE ... PARTITION OF ... does. I'm > working on revising this fix. We

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Alexander Korotkov
On Thu, Apr 11, 2024 at 8:00 PM Alexander Lakhin wrote: > 11.04.2024 16:27, Dmitry Koval wrote: > > > > Added correction (and test), see > > v3-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch. > > > > Thank you for the correction, but may be an attempt to merge into implicit >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Alexander Lakhin
11.04.2024 16:27, Dmitry Koval wrote: Added correction (and test), see v3-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch. Thank you for the correction, but may be an attempt to merge into implicit pg_temp should fail just like CREATE TABLE ... PARTITION OF ... does? Please

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Alexander Korotkov
Hi, Dmitry! On Thu, Apr 11, 2024 at 4:27 PM Dmitry Koval wrote: > 1. > Alexander Lakhin sent a question about index name after MERGE (partition > name is the same as one of the merged partitions): > > start of quote > I'm also confused by an index name after MERGE: > CREATE TABLE t (i

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Dmitry Koval
Hi! 1. Alexander Lakhin sent a question about index name after MERGE (partition name is the same as one of the merged partitions): start of quote I'm also confused by an index name after MERGE: CREATE TABLE t (i int) PARTITION BY RANGE (i); CREATE TABLE tp_0_1 PARTITION OF t FOR

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Alexander Lakhin
Hi Dmitry, 11.04.2024 11:59, Dmitry Koval wrote: FWIW, I also proposed a patch earlier that fixes error messages and comments in the split partition code Sorry, I thought all the fixes you suggested were already included in v1-0002-Fixes-for-english-text.patch (but they are not). Added

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Dmitry Koval
Hi! FWIW, I also proposed a patch earlier that fixes error messages and comments in the split partition code Sorry, I thought all the fixes you suggested were already included in v1-0002-Fixes-for-english-text.patch (but they are not). Added missing lines to

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-11 Thread Richard Guo
On Thu, Apr 11, 2024 at 1:22 AM Dmitry Koval wrote: > 2) v1-0002-Fixes-for-english-text.patch - fixes for English text > (comments, error messages etc.). FWIW, I also proposed a patch earlier that fixes error messages and comments in the split partition code at

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-10 Thread Dmitry Koval
Hi! Alexander Korotkov, thanks for the commit of previous fix. Alexander Lakhin, thanks for the problem you found. There are two corrections attached to the letter: 1) v1-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch - fix for the problem [1]. 2)

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-10 Thread Alexander Lakhin
10.04.2024 12:00, Alexander Lakhin wrote: Hello Alexander and Dmitry, 10.04.2024 02:03, Alexander Korotkov wrote: Thank you.  I've pushed this fix with minor corrections from me. Please look at another anomaly with MERGE. CREATE TEMP TABLE t (i int) PARTITION BY RANGE (i); CREATE TABLE

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-10 Thread Alexander Lakhin
Hello Alexander and Dmitry, 10.04.2024 02:03, Alexander Korotkov wrote: On Mon, Apr 8, 2024 at 11:43 PM Dmitry Koval wrote: 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

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-09 Thread Alexander Korotkov
On Mon, Apr 8, 2024 at 11:43 PM Dmitry Koval wrote: > 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

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 Postgres

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-08 Thread Alexander Lakhin
Hi Tender Wang, 08.04.2024 13:43, Tender Wang wrote: Hi all,   I went through the MERGE/SPLIT partition codes today, thanks for the works.  I found some grammar errors:  i. in error messages(Users can see this grammar errors, not friendly). ii. in codes comments On a quick glance, I saw

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-08 Thread Tender Wang
Hi all, I went through the MERGE/SPLIT partition codes today, thanks for the works. I found some grammar errors: i. in error messages(Users can see this grammar errors, not friendly). ii. in codes comments Alexander Korotkov 于2024年4月7日周日 06:23写道: > Hi, Dmitry! > > On Fri, Apr 5, 2024 at

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-08 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-07 Thread Alexander Lakhin
08.04.2024 01:15, Alexander Korotkov wrote: Thank you for spotting this. This seems like a missing check. I'm going to get a closer look at this tomorrow. Thanks! There is also an anomaly with the MERGE command: CREATE TABLE t1 (i int, a int, b int, c int) PARTITION BY RANGE (a, b); CREATE

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-07 Thread Alexander Korotkov
Hi, Alexander! On Sun, Apr 7, 2024 at 10:00 PM Alexander Lakhin wrote: > 07.04.2024 01:22, Alexander Korotkov wrote: > > I've pushed 0001 and 0002. I didn't push 0003 for the following reasons. > > Please try the following (erroneous) query: > CREATE TABLE t1(i int, t text) PARTITION BY LIST

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-07 Thread Alexander Lakhin
Hi Alexander and Dmitry, 07.04.2024 01:22, Alexander Korotkov wrote: I've pushed 0001 and 0002. I didn't push 0003 for the following reasons. Please try the following (erroneous) query: CREATE TABLE t1(i int, t text) PARTITION BY LIST (t); CREATE TABLE t1pa PARTITION OF t1 FOR VALUES IN

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-04-06 Thread Alexander Korotkov
Hi, Dmitry! On Fri, Apr 5, 2024 at 4:00 PM Dmitry Koval wrote: > > I've revised the patchset. > > Thanks for the corrections (especially ddl.sgml). > Could you also look at a small optimization for the MERGE PARTITIONS > command (in a separate file >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-05 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed All three patches applied nivcely. Code fits standart,

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-27 Thread Dmitry Koval
Hi! > I've fixed that by skipping a copy of the identity of another > partition (remove CREATE_TABLE_LIKE_IDENTITY from > TableLikeClause.options). Thanks for correction! Probably I should have looked at the code more closely after commit [1]. I'm also very glad that situation [2] was

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-25 Thread Alexander Korotkov
On Tue, Sep 20, 2022 at 3:21 PM Robert Haas wrote: > On Mon, Sep 19, 2022 at 4:42 PM Dmitry Koval wrote: > > Thanks for comments and advice! > > I thought about this problem and discussed about it with colleagues. > > Unfortunately, I don't know of a good general solution. > > Yeah, me neither.

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: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-19 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: not tested Spec compliant: not tested Documentation:not tested Sorry, tests passed when applying all patches. I planned to check

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-19 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: not tested Spec compliant: not tested Documentation:not tested Hi, I have failing tap test after patches apply: ok 201 +

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-03-08 Thread Andrey M. Borodin
> On 26 Jan 2024, at 23:36, Dmitry Koval wrote: > > The CF entry was in Ready for Committer state no so long ago. Stephane, you might want to review recent version after it was rebased on current HEAD. CFbot's test passed successfully. Thanks! Best regards, Andrey Borodin.

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-01-26 Thread Alvaro Herrera
On 2024-Jan-26, Alvaro Herrera wrote: > On 2024-Jan-26, vignesh C wrote: > > > Please post an updated version for the same. > > Here's a rebase. I only fixed the conflicts, didn't review. Hmm, but I got the attached regression.diffs with it. I didn't investigate further, but it looks like

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-01-26 Thread vignesh C
On Mon, 4 Dec 2023 at 13:22, Dmitry Koval wrote: > > Hello! > > Added commit v21-0004-SPLIT-PARTITION-optimization.patch. CFBot shows that the patch does not apply anymore as in [1]: === Applying patches on top of PostgreSQL commit ID 8ba6fdf905d0f5aef70ced4504c6ad297bfe08ea === === applying

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-07-20 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed It is just a rebase I check with make and meson run manual

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-07-18 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested Only documentation patch applied on 4e465aac36ce9a9533c68dbdc83e67579880e628

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-07-06 Thread Daniel Gustafsson
This patch no longer applies to master, please submit a rebased version to the thread. I've marked the CF entry as waiting for author in the meantime. -- Daniel Gustafsson

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-03-29 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, failed Hi, Just a minor warning with documentation patch git apply

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-03-28 Thread stephane tachoires
Hi, Patch v15-0001-ALTER-TABLE-MERGE-PARTITIONS-command.patch Apply nicely. One warning on meson compile (configure -Dssl=openssl -Dldap=enabled -Dauto_features=enabled -DPG_TEST_EXTRA='ssl,ldap,kerberos' -Dbsd_auth=disabled -Dbonjour=disabled -Dpam=disabled -Dpltcl=disabled -Dsystemd=disabled

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-03-19 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, failed Feature is clearly missing with partition handling in

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-10-11 Thread Zhihong Yu
On Tue, Oct 11, 2022 at 9:58 AM Zhihong Yu wrote: > > > On Tue, Oct 11, 2022 at 9:22 AM Dmitry Koval > wrote: > >> Hi! >> >> Fixed couple warnings (for cfbot). >> >> -- >> With best regards, >> Dmitry Koval >> >> Postgres Professional: http://postgrespro.com > > Hi, > For

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-10-11 Thread Zhihong Yu
On Tue, Oct 11, 2022 at 9:22 AM Dmitry Koval wrote: > Hi! > > Fixed couple warnings (for cfbot). > > -- > With best regards, > Dmitry Koval > > Postgres Professional: http://postgrespro.com Hi, For v12-0001-PGPRO-ALTER-TABLE-MERGE-PARTITIONS-command.patch: + if (equal(name, cmd->name)) +

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-20 Thread Robert Haas
On Mon, Sep 19, 2022 at 4:42 PM Dmitry Koval wrote: > Thanks for comments and advice! > I thought about this problem and discussed about it with colleagues. > Unfortunately, I don't know of a good general solution. Yeah, me neither. > But for specific situation like this (certain partition is

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-19 Thread Dmitry Koval
Thanks for comments and advice! I thought about this problem and discussed about it with colleagues. Unfortunately, I don't know of a good general solution. 19.09.2022 22:56, Robert Haas пишет: If you know that a certain partition is not changing, and you would like to split it, you can create

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-19 Thread Robert Haas
On Tue, May 31, 2022 at 5:33 AM Dmitry Koval wrote: > There are not many commands in PostgreSQL for working with partitioned > tables. This is an obstacle to their widespread use. > Adding SPLIT PARTITION/MERGE PARTITIONS operations can make easier to > use partitioned tables in PostgreSQL. >

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: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-08 Thread Alvaro Herrera
On 2022-Sep-08, Justin Pryzby wrote: > If the patch were split into separate parts for MERGE and SPLIT, would > the first patch be significantly smaller than the existing patch > (hopefully half as big) ? That would help to review it, even if both > halves were ultimately squished together. (An

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-08 Thread Justin Pryzby
On Thu, Sep 08, 2022 at 02:35:24PM +0300, Dmitry Koval wrote: > Thanks a lot Justin! > > After compilation PostgreSQL+patch with macros > RELCACHE_FORCE_RELEASE, > RANDOMIZE_ALLOCATED_MEMORY, > I saw a problem on Windows 10, MSVC2019. Yes, it passes tests on my CI improvements branch.

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-07 Thread Justin Pryzby
On Wed, Sep 07, 2022 at 08:03:09PM +0300, Dmitry Koval wrote: > Hi! > > Patch stop applying due to changes in upstream. > Here is a rebased version. This crashes on freebsd with -DRELCACHE_FORCE_RELEASE https://cirrus-ci.com/task/6565371623768064 https://cirrus-ci.com/task/6145355992530944 Note

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: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-07-14 Thread Alvaro Herrera
This is not a review, but I think the isolation tests should be expanded. At least, include the case of serializable transactions being involved. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "Pensar que el espectro que vemos es ilusorio no lo despoja de

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-07-13 Thread Zhihong Yu
On Wed, Jul 13, 2022 at 1:05 PM Dmitry Koval wrote: > Thanks you! > I've fixed all things mentioned. > > -- > With best regards, > Dmitry Koval > > Postgres Professional: http://postgrespro.com Hi, Toward the end of ATExecSplitPartition(): + /* Unlock new partition. */ +

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-07-13 Thread Zhihong Yu
On Wed, Jul 13, 2022 at 11:28 AM Dmitry Koval wrote: > Hi! > > Patch stop applying due to changes in upstream. > Here is a rebased version. > > -- > With best regards, > Dmitry Koval > > Postgres Professional: http://postgrespro.com Hi, +attachPartTable(List **wqueue, Relation rel, Relation

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-06-01 Thread Zhihong Yu
On Wed, Jun 1, 2022 at 11:58 AM Dmitry Koval wrote: > Hi, > > 1) > > For attachPartTable, the parameter wqueue is missing from comment. > > The parameters of CloneRowTriggersToPartition are called parent and > partition. > > I think it is better to name the parameters to attachPartTable in a >

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-05-31 Thread Zhihong Yu
On Tue, May 31, 2022 at 1:43 PM Zhihong Yu wrote: > > > On Tue, May 31, 2022 at 12:43 PM Dmitry Koval > wrote: > >> >Just out of curiosity, why is SPLIT / MERGE support not included for >> >HASH partitions? Because sibling partitions can have a different >> >modulus, you should be able to

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-05-31 Thread Zhihong Yu
On Tue, May 31, 2022 at 12:43 PM Dmitry Koval wrote: > >Just out of curiosity, why is SPLIT / MERGE support not included for > >HASH partitions? Because sibling partitions can have a different > >modulus, you should be able to e.g. split a partition with (modulus, > >remainder) of (3, 1)

  1   2   >