Re: BUG #15873: Attaching a partition fails because it sees deleted columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dwilches(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15873: Attaching a partition fails because it sees deleted columns
Date: 2019-06-25 21:49:56
Message-ID: 28917.1561499396@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Bug reference: 15873
> PostgreSQL version: 11.2

> I'm trying to attach a partition to one of my partitioned tables and I'm
> getting an error:
> ERROR: 42703: attribute 4 of type my_table_000000_partition has been
> dropped

FWIW, I tried to reproduce this using the attached example. Works
fine here. However, this report sounds quite a lot like some partitioning
bugs that have been fixed in the past. Could you update to 11.4 and try
again? If it still fails, then there's some aspect of your problem table
that you have not told us about.

regards, tom lane

drop table if exists pparent;

create table pparent(f1 int, z int, f2 int, my_timestamp timestamptz, f3 int)
partition by range (my_timestamp);

alter table pparent drop column z;

create table defchild (f1 int, f2 int,
bogus1 text, my_timestamp timestamptz, bogus2 text, f3 int);

alter table defchild drop column bogus1, drop column bogus2;

alter table pparent attach partition defchild default;

create table otherchild (like defchild including all);

alter table pparent attach partition otherchild
for values from ('2019-01-01') to ('2020-01-01');

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-06-26 01:22:56 Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
Previous Message PG Bug reporting form 2019-06-25 21:30:44 BUG #15873: Attaching a partition fails because it sees deleted columns