Re: Accidentally dropped constraints: bug? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Accidentally dropped constraints: bug?
Date
Msg-id 20210805200901.GA10792@momjian.us
Whole thread Raw
In response to Accidentally dropped constraints: bug?  (Simon Riggs <simon.riggs@enterprisedb.com>)
List pgsql-hackers
On Thu, Aug  5, 2021 at 08:35:46AM +0100, Simon Riggs wrote:
> If we drop a column we cascade that drop to all indexes and all
> constraints that mention that column, even if they include other
> columns also. We might expect that indexes should be dropped
> automatically, but the latter behavior for constraints seems like a
> bug, since it can silently remove constraints that might still be
> valid without the dropped column. (Example below). This is even more
> surprising if the user specifies RESTRICT explicitly. I note that this
> is acting as documented, it's just the docs don't explain the full
> implications, so I'm guessing we didn't think about this before.

Wow, I certainly never thought of it or heard anyone complain about it.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: straightening out backend process startup
Next
From: Andres Freund
Date:
Subject: Re: RFC: Improve CPU cache locality of syscache searches