Re: creating CHECK constraints as NOT VALID

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: creating CHECK constraints as NOT VALID
Дата
Msg-id BANLkTimHPoEXGfdp=cckh0Ln_FAaCQJxdg@mail.gmail.com
обсуждение исходный текст
Ответ на creating CHECK constraints as NOT VALID  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On Tue, May 31, 2011 at 12:04 PM, Alvaro Herrera
<alvherre@alvh.no-ip.org> wrote:
> This patch allows you to initially declare a CHECK constraint as NOT
> VALID, similar to what we already allow for foreign keys.  That is, you
> create the constraint without scanning the table and after it is
> committed, it is enforced for new rows; later, all rows are checked by
> running ALTER TABLE VALIDATE CONSTRAINT, which doesn't need
> AccessExclusive thus allowing for better concurrency.
>
> The trickiest bit here was realizing that unlike FKs, check constraints
> do inherit, and so needed special treatment for recursion.  Other than
> that I think this was pretty straightforward.
>
> I intend to attempt to apply this to NOT NULL constraints as well, once
> the patch to add them to pg_constraint is in.

Seems like a logical extension of what we have now.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: creating CHECK constraints as NOT VALID
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [PATCH] Bug in XPATH() if expression returns a scalar value