Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints
Дата
Msg-id 202501080913.bs6k2rk2xc2j@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints  (Suraj Kharage <suraj.kharage@enterprisedb.com>)
Список pgsql-hackers
On 2024-Nov-25, Suraj Kharage wrote:

> Another case which needs conclusion is -
> When changing from INHERIT to NO INHERIT, we need to walk all children and
> decrement coninhcount for the corresponding constraint. If a constraint in
> one child reaches zero, should we drop it?  not sure. If we do, make sure
> to reset the corresponding attnotnull bit too. We could decide not to drop
> the constraint, in which case you don’t need to reset attnotnull.

I think it's more useful if we keep such a constraint (but of course
change its conislocal to true, if it isn't that already).

There are arguments for doing both things (drop it or leave it); but if
you drop it, there's no way to put it back without scanning the table
again.  If you keep it, it's easy to drop it afterwards.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Postgres is bloatware by design: it was built to house
 PhD theses." (Joey Hellerstein, SIGMOD annual conference 2002)



В списке pgsql-hackers по дате отправления: