public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Lakhin <[email protected]>
To: Robert Haas <[email protected]>
To: Alexander Korotkov <[email protected]>
Cc: Dmitry Koval <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: Mon, 15 Apr 2024 18:00:00 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoaWVq0omunhPzwKt=L7fqUFDgJcLiodmZ_ZqBNiPxzY+Q@mail.gmail.com>
References: <[email protected]>
	<CAPpHfdtTgSdbzfcEz_mgVxh8VSDP=VfQ6r4T1n9SMT_impbDiA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAMbWs49c_7dT_oiP729b-JPRiDtTuDca3exN_cOZZwjGG-0bMA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAPpHfdv1ZkY9cPOqsLvDY9AA-fCYKHM4P07+-Mu+xq5o=daS6w@mail.gmail.com>
	<CA+TgmoYcjL+w2BQzku5iNXKR5fyxJMSP3avQta8xngioTX7D7A@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAPpHfdv-uR663BO6G2kRuLEQjob+UBHuD3iyXF+qGHXQFRN0-Q@mail.gmail.com>
	<CA+TgmoaWVq0omunhPzwKt=L7fqUFDgJcLiodmZ_ZqBNiPxzY+Q@mail.gmail.com>

Hello Robert,

15.04.2024 17:30, Robert Haas wrote:
> On Sat, Apr 13, 2024 at 6:05 AM Alexander Korotkov <[email protected]> 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 ordinary table",
>
> This is not a phrasing that we use in any other error message. We
> always just say "is not a table".

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');
CREATE FOREIGN TABLE ftp_1_2 PARTITION OF t
   FOR VALUES FROM (1) TO (2)
   SERVER loopback OPTIONS (table_name 'lt_1_2');
ALTER TABLE t MERGE PARTITIONS (ftp_0_1, ftp_1_2) INTO ftp_0_2;
ERROR:  "ftp_0_1" is not a table
(Isn't a foreign table a table?)

And also:
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 t2 (i int) PARTITION BY RANGE (i);
ALTER TABLE t MERGE PARTITIONS (tp_0_1, t2) INTO tpn;
ERROR:  "t2" is not a table
(Isn't a partitioned table a table?)

And in fact, an ordinary table is not suitable for MERGE anyway:
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 t2 (i int);
ALTER TABLE t MERGE PARTITIONS (tp_0_1, t2) INTO tpn;
ERROR:  "t2" is not a partition

So I don't think that "an ordinary table" is a good (unambiguous) term
either.

Best regards,
Alexander






view thread (48+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
  In-Reply-To: <[email protected]>

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

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