pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Dmitry Koval <d.koval@postgrespro.ru>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: Thu, 11 Apr 2024 15:00:00 +0300
Message-ID: <fdaa003e-919c-cbc9-4f0c-e4546e96bd65@gmail.com> (raw)
In-Reply-To: <b907ce77-c054-4009-a871-4d55cb3f73f9@postgrespro.ru>
References: <c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582@postgrespro.ru>
	<a83d5a56-ff33-47e8-b2d8-7e9a5d59ee1e@postgrespro.ru>
	<CAPpHfdsCCV8DOv0Ovu4dTSnuWXiEz_AjuW-J6TPj++tcfEGvRw@mail.gmail.com>
	<3a4b9c1c-3edf-4e29-9629-b4113aefb0f3@postgrespro.ru>
	<CAPpHfduNYkMVuUSxZjD6u4tZG6aKdhgQcmhr-K9OQfeg56MNww@mail.gmail.com>
	<c3730d78-6081-4c41-9715-d1d192734576@postgrespro.ru>
	<CAPpHfdtj7YsPaASoVPN+N3H4_Ct+kQw8QY1d_9u7FPnbghkicw@mail.gmail.com>
	<CAHewXNkGMPU50QG7V6Q60JGFORfo8LfYO1_GCkCa0VWbmB-fEw@mail.gmail.com>
	<28ed1ee0-749d-9838-955e-abff42fc44be@gmail.com>
	<ce654fca-74cf-44fb-a7e6-d35e3718179c@postgrespro.ru>
	<CAPpHfdtTgSdbzfcEz_mgVxh8VSDP=VfQ6r4T1n9SMT_impbDiA@mail.gmail.com>
	<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>

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 missing lines to v2-0002-Fixes-for-english-text.patch.
>

It seems to me that v2-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch
is not complete either.
Take a look, please:
CREATE TABLE t (i int) PARTITION BY RANGE (i);
SET search_path = pg_temp, public;
CREATE TABLE tp_0_1 PARTITION OF t
   FOR VALUES FROM (0) TO (1);
-- fails with:
ERROR:  cannot create a temporary relation as partition of permanent relation "t"

But:
CREATE TABLE t (i int) PARTITION BY RANGE (i);
CREATE TABLE tp_0_1 PARTITION OF t
   FOR VALUES FROM (0) TO (1);
CREATE TABLE tp_1_2 PARTITION OF t
   FOR VALUES FROM (1) TO (2);
INSERT INTO t VALUES(0), (1);
SELECT * FROM t;
-- the expected result is:
  i
---
  0
  1
(2 rows)

SET search_path = pg_temp, public;
ALTER TABLE t
MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
-- succeeds, and
\c -
SELECT * FROM t;
-- gives:
  i
---
(0 rows)

Please also ask your tech writers to check contents of src/test/sql/*, if
possible (perhaps, they'll fix "salesmans" and improve grammar).

Best regards,
Alexander

view thread (298+ messages)  latest in thread

Message-ID: <fdaa003e-919c-cbc9-4f0c-e4546e96bd65@gmail.com>
Permalink:  ../fdaa003e-919c-cbc9-4f0c-e4546e96bd65@gmail.com/
Also on:    postgresql.org/message-id/fdaa003e-919c-cbc9-4f0c-e4546e96bd65@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, d.koval@postgrespro.ru, guofenglinux@gmail.com, aekorotkov@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
  In-Reply-To: <fdaa003e-919c-cbc9-4f0c-e4546e96bd65@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