pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
To: Dmitry Koval <d.koval@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: Thu, 18 Apr 2024 19:00:00 +0300
Message-ID: <5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com> (raw)
In-Reply-To: <CAPpHfdvShLh5txtQdh6=ZMCnzGZHv8W+RHAe8pY94rfzghWTAg@mail.gmail.com>
References: <c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582@postgrespro.ru>
	<b56918c2-b099-9875-aa4e-8fd405cdb6ab@gmail.com>
	<dbc8b96c-3cf0-d1ee-860d-0e491da20485@gmail.com>
	<86bfd241-a58c-479a-9a72-2c67a02becf8@postgrespro.ru>
	<CAMbWs49c_7dT_oiP729b-JPRiDtTuDca3exN_cOZZwjGG-0bMA@mail.gmail.com>
	<b907ce77-c054-4009-a871-4d55cb3f73f9@postgrespro.ru>
	<fdaa003e-919c-cbc9-4f0c-e4546e96bd65@gmail.com>
	<edfbd846-dcc1-42d1-ac26-715691b687d3@postgrespro.ru>
	<0f655bcd-6487-4179-f9cf-c248efbad510@gmail.com>
	<CAPpHfdv1ZkY9cPOqsLvDY9AA-fCYKHM4P07+-Mu+xq5o=daS6w@mail.gmail.com>
	<CA+TgmoYcjL+w2BQzku5iNXKR5fyxJMSP3avQta8xngioTX7D7A@mail.gmail.com>
	<e711faa8-826d-434d-b197-ab51da518fe7@postgrespro.ru>
	<f79fa76f-de07-b930-0bc7-359d6cbab159@gmail.com>
	<b156efc2-5e6d-4eae-8e60-2d483987b42c@postgrespro.ru>
	<CAPpHfdv-uR663BO6G2kRuLEQjob+UBHuD3iyXF+qGHXQFRN0-Q@mail.gmail.com>
	<56e0000c-6b39-44ce-90b4-d3c3062e408c@postgrespro.ru>
	<CAPpHfdvShLh5txtQdh6=ZMCnzGZHv8W+RHAe8pY94rfzghWTAg@mail.gmail.com>

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
> createPartitionTable() after ProcessUtility() as pointed out by
> Robert.  So, no need to place the lock again.
> 3) Added fix for problematic error message as a separate patch [1].
> 4) Added rename "salemans" => "salesmen" for tests as a separate patch.
>
> I think these fixes are reaching committable shape, but I'd like
> someone to check it before I push.

I think the feature implementation should also provide tab completion for
SPLIT/MERGE.
(ALTER TABLE t S<Tab>
fills in only SET now.)

Also, the following MERGE operation:
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);
ALTER TABLE t MERGE PARTITIONS (tp_0, tp_1) INTO tp_0;

leaves a strange constraint:
\d+ t*
                                           Table "public.tp_0"
...
Not-null constraints:
     "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i"

Best regards,
Alexander





view thread (298+ messages)  latest in thread

Message-ID: <5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com>
Permalink:  ../5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com/
Also on:    postgresql.org/message-id/5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, aekorotkov@gmail.com, d.koval@postgrespro.ru, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
  In-Reply-To: <5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox