Re: BUG #15873: Attaching a partition fails because it sees deleted columns - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15873: Attaching a partition fails because it sees deleted columns
Date
Msg-id 28917.1561499396@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15873: Attaching a partition fails because it sees deleted columns  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15873: Attaching a partition fails because it sees deleted columns
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.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');



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15873: Attaching a partition fails because it sees deleted columns
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017