From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: petr.fedorov@phystech.edu
Subject: BUG #15733: An insert destined at partition created after a column has been dropped from the parent table fails
Date: Wed, 03 Apr 2019 18:22:34 +0000
Message-ID: <15733-7692379e310b80ec@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15733
Logged by: Petr Fedorov
Email address: petr.fedorov@phystech.edu
PostgreSQL version: 11.2
Operating system: Centos7
Description:
Steps to reproduce:
1. Create a table to be partitioned
create table public.partitioned ( id integer not null, level1 integer not
null, level2 integer not null, level3 integer not null, data1 integer not
null, data2 integer not null) partition by list (level1) ;
2. Create partitions for some values:
create table public.partitioned_1 partition of public.partitioned for
values in (1) partition by list(level2);
create table public.partitioned_1_1 partition of public.partitioned_1 for
values in (1) partition by list(level3);
create table public.partitioned_1_1_1 partition of public.partitioned_1_1
for values in (1);
3. Drop some column from the partitioned table:
alter table partitioned drop column data1;
4. Create partitions for another value:
create table public.partitioned_2 partition of public.partitioned for
values in (2) partition by list(level2);
create table public.partitioned_2_1 partition of public.partitioned_2 for
values in (1) partition by list (level3);
create table public.partitioned_2_1_1 partition of public.partitioned_2_1
for values in (1);
5. Insert the row which would land at partitioned_1_1_1 - works:
insert into partitioned values(1,1,1,1,1);
6. FAIL: Insert the row which would land at partitioned_2_1_1:
insert into partitioned values(2,2,1, 1,1);
ERROR: cannot extract attribute from empty tuple slot SQL state: XX000
7. Still you can insert using partition_2 - works:
insert into partitioned_2 values(2,2,1, 1,1);
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, petr.fedorov@phystech.edu
Subject: Re: BUG #15733: An insert destined at partition created after a column has been dropped from the parent table fails
In-Reply-To: <15733-7692379e310b80ec@postgresql.org>
References: <15733-7692379e310b80ec@postgresql.org>
* 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