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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: cache lookup failed for constraint when alter table referred by partition table
Date: 2018-09-13 16:47:08
Message-ID: 9521.1536857228@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> 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 of this:

- * Now we can drop the existing constraints and indexes --- constraints
- * first, since some of them might depend on the indexes. In fact, we
- * have to delete FOREIGN KEY constraints before UNIQUE constraints, but
- * we already ordered the constraint list to ensure that would happen.

can we make any simplifications in earlier steps? At the very least,
look for comments related to this assumption.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2018-09-13 16:51:26 PostgreSQL 11 {Beta 4, RC1} Release: 2018-09-20
Previous Message Alvaro Herrera 2018-09-13 16:35:04 Re: cache lookup failed for constraint when alter table referred by partition table