Re: To-Do item: skip table scan for adding column with provable check constraints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: To-Do item: skip table scan for adding column with provable check constraints
Дата
Msg-id 20169.1464130592@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: To-Do item: skip table scan for adding column with provable check constraints  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Ответы Re: To-Do item: skip table scan for adding column with provable check constraints  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> ... and if the CHECK expression is immutable ...

> Doesn't it have to be already?

AFAIK we don't insist on that currently.  You could imagine useful checks
that are not, for example CHECK(write_timestamp <= now()).

> Otherwise a value accepted at one point in time could suddenly violate
> the constraint later, even though it never changed.

True.  If you use a non-immutable check, it's on your head whether or not
this is a problem.  But the database shouldn't perform optimizations that
just assume it's immutable without checking.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: statistics for shared catalogs not updated when autovacuum is off
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [sqlsmith] PANIC: failed to add BRIN tuple