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: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Richard Guo <guofenglinux@gmail.com>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: Wed, 10 Apr 2024 15:00:00 +0300
Message-ID: <dbc8b96c-3cf0-d1ee-860d-0e491da20485@gmail.com> (raw )
In-Reply-To: <b56918c2-b099-9875-aa4e-8fd405cdb6ab@gmail.com >
References: <c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582@postgrespro.ru >
<171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org >
<171085858750.2046434.12246066729700037354.pgcf@coridan.postgresql.org >
<909e16b4-9eda-435c-b033-8294ae4adc05@postgrespro.ru >
<CAPpHfdsVQwnZPxaQPwcu1g_01F0d-o=ECRcf14X3CmavJB6vSQ@mail.gmail.com >
<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 >
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 tp_0_2 PARTITION OF t
FOR VALUES FROM (0) TO (2);
fails with
ERROR: cannot create a permanent relation as partition of temporary relation "t"
But
CREATE TEMP TABLE t (i int) PARTITION BY RANGE (i);
CREATE TEMP TABLE tp_0_1 PARTITION OF t
FOR VALUES FROM (0) TO (1);
CREATE TEMP TABLE tp_1_2 PARTITION OF t
FOR VALUES FROM (1) TO (2);
ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
succeeds and we get:
regression=# \d+ t*
Partitioned table "pg_temp_1.t"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
--------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
i | integer | | | | plain | | |
Partition key: RANGE (i)
Partitions: tp_0_2 FOR VALUES FROM (0) TO (2)
Table "public.tp_0_2"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
--------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
i | integer | | | | plain | | |
Partition of: t FOR VALUES FROM (0) TO (2)
Partition constraint: ((i IS NOT NULL) AND (i >= 0) AND (i < 2))
Best regards,
Alexander
view thread (298+ messages) latest in thread
Message-ID: <dbc8b96c-3cf0-d1ee-860d-0e491da20485@gmail.com>
Permalink: ../dbc8b96c-3cf0-d1ee-860d-0e491da20485@gmail.com/
Also on: postgresql.org/message-id/dbc8b96c-3cf0-d1ee-860d-0e491da20485@gmail.com
copy link · copy postgr.es
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, pgsql-hackers@lists.postgresql.org, guofenglinux@gmail.com
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
In-Reply-To: <dbc8b96c-3cf0-d1ee-860d-0e491da20485@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