Re: BUG #6612: Functions can be called inside CHECK statements

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: BUG #6612: Functions can be called inside CHECK statements
Дата
Msg-id CAM-w4HPq43NnPSE+7H1GwCZGzxCmd3Kwj_RzFZDn3UQsveHxow@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6612: Functions can be called inside CHECK statements  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: BUG #6612: Functions can be called inside CHECK statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Wed, Apr 25, 2012 at 4:06 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> A CHECK constraint using a volatile function is potentially valid
> and useful, IMO. =A0Think about a column which is supposed to record
> the moment of an event which has occurred. =A0It could make sense to
> ensure that the timestamptz value is < now(); =A0On the other hand, an
> index entry based on now() is clearly a problem.
>
> Otherwise I agree with your response -- this is clearly *not* a bug.

Hm. I suppose it depends on what you think a constraint is. I had
always thought it was a guarantee that all the data in the table would
meet that constraint. Not just a procedural definition for something
to do at certain points in time.

But I guess I responded based on my understanding without checking
whether it was right. sorry.

Hm, but this does raise the question of whether they're the right
thing to be basing the partitioning constraint exclusion code on. I'll
speculate without checking again that we check the immutability of the
constraint before using it in constraint exclusion but that seems a
ad-hoc.


--=20
greg

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6612: Functions can be called inside CHECK statements
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6612: Functions can be called inside CHECK statements