Re: cache lookup failed for constraint when alter table referred bypartition table - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: cache lookup failed for constraint when alter table referred bypartition table
Date
Msg-id 20180913163504.ecvozcnighb6cbxm@alvherre.pgsql
Whole thread Raw
In response to Re: cache lookup failed for constraint when alter table referred bypartition table  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: cache lookup failed for constraint when alter table referred by partition table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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
index/constraint objects together in one performMultipleDeletions()
instead of performDeletion() one by one, as in the attached patch.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Jesper Pedersen
Date:
Subject: Re: Index Skip Scan
Next
From: Tom Lane
Date:
Subject: Re: cache lookup failed for constraint when alter table referred by partition table