Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-14 Thread Alvaro Herrera
Thanks Rajkumar, Tom, Justin -- pushed fix. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-13 Thread Alvaro Herrera
On 2018-Sep-13, Tom Lane wrote: > Alvaro Herrera writes: > > That's the problem all right. The solution is to drop all > > index/constraint objects together in one performMultipleDeletions() > > instead of performDeletion() one by one, as in the attached patch. > > Looks reasonable as far as

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-13 Thread Tom Lane
Alvaro Herrera writes: > That's the problem all right. The solution is to drop all > index/constraint objects together in one performMultipleDeletions() > instead of performDeletion() one by one, as in the attached patch. Looks reasonable as far as it goes. Given that we no longer require any

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-13 Thread Alvaro Herrera
On 2018-Sep-10, Alvaro Herrera wrote: > ATPostAlterTypeCleanup is trying to search the original constraint by > OID in order to drop it, but it's not there -- I suppose it has already > been dropped by recursion in a previous step. That's the problem all right. The solution is to drop all

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-10 Thread Alvaro Herrera
On 2018-Sep-10, Alvaro Herrera wrote: > On 2018-Sep-10, Justin Pryzby wrote: > > > Adding Alvaro > > > > On Fri, Sep 07, 2018 at 04:02:13PM +0530, Rajkumar Raghuwanshi wrote: > > > postgres=# CREATE TABLE non_part (a INT,PRIMARY KEY(a)); > > > postgres=# CREATE TABLE part (a INT REFERENCES

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-10 Thread Alvaro Herrera
On 2018-Sep-10, Justin Pryzby wrote: > Adding Alvaro > > On Fri, Sep 07, 2018 at 04:02:13PM +0530, Rajkumar Raghuwanshi wrote: > > postgres=# CREATE TABLE non_part (a INT,PRIMARY KEY(a)); > > postgres=# CREATE TABLE part (a INT REFERENCES non_part(a)) PARTITION BY > > RANGE(a); > > postgres=#

Re: cache lookup failed for constraint when alter table referred by partition table

2018-09-10 Thread Justin Pryzby
Adding Alvaro On Fri, Sep 07, 2018 at 04:02:13PM +0530, Rajkumar Raghuwanshi wrote: > postgres=# CREATE TABLE non_part (a INT,PRIMARY KEY(a)); > postgres=# CREATE TABLE part (a INT REFERENCES non_part(a)) PARTITION BY > RANGE(a); > postgres=# CREATE TABLE part_p1 PARTITION OF part FOR VALUES

cache lookup failed for constraint when alter table referred by partition table

2018-09-07 Thread Rajkumar Raghuwanshi
Hi, I am getting cache lookup failed for constraint error on master and 11beta3 with below test case. [edb@localhost bin]$ ./psql postgres psql (11beta3) Type "help" for help. postgres=# CREATE TABLE non_part (a INT,PRIMARY KEY(a)); CREATE TABLE postgres=# CREATE TABLE part (a INT REFERENCES