Re: Accidentally dropped constraints: bug?
От | Mark Dilger |
---|---|
Тема | Re: Accidentally dropped constraints: bug? |
Дата | |
Msg-id | 0585B8C1-4E5E-4E02-BCC0-DE6737602623@enterprisedb.com обсуждение исходный текст |
Ответ на | Accidentally dropped constraints: bug? (Simon Riggs <simon.riggs@enterprisedb.com>) |
Список | pgsql-hackers |
> On Aug 5, 2021, at 12:35 AM, Simon Riggs <simon.riggs@enterprisedb.com> wrote: > > Noting that all constraints have been removed, not just the ones > wholly dependent on dropped columns. I don't find this all that surprising. If CHECK (a > 5 AND b IS NOT NULL AND c > 10) is really meant as three independentchecks, it should be written that way. However, for any row where c is null, the entire expression will eitherbe null or false, and the check will fail precisely when (a > 5 AND b IS NOT NULL) is false. So if you imagine thedropped column as a column of phantom null values, you'd expect the check to still reject rows where a <= 5 or b is null. Is it reasonable to imagine the dropped column as implicitly full of nulls? That's how an added column works, but do wethink about dropped columns that way? In any event, the documentation is pretty clear about this: > DROP COLUMN [ IF EXISTS ] > This form drops a column from a table. Indexes and table constraints involving the column will be automatically droppedas well. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: