Re: Problem with subquery in CHECK constraint.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with subquery in CHECK constraint.
Дата
Msg-id 3912.960392918@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with subquery in CHECK constraint.  (Niall Smart <niall.smart@ebeon.com>)
Ответы RE: Problem with subquery in CHECK constraint.  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-sql
Niall Smart <niall.smart@ebeon.com> writes:
> However when trying to insert into CUST I get the following error:
>         ERROR:  ExecEvalExpr: unknown expression type 108
> Is this a bug in PostGreSQL?

Yup.  Looks like the subquery is not getting expanded into a subplan.
Could be a little messy to fix, unless we redo the planning on every
execution of the check constraint ... which doesn't sound appetizing.

For now I'd suggest putting the subquery into an SQL or plpgsql function
that you invoke from the constraint expression.
        regards, tom lane


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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: oracle rownum equivalent?
Следующее
От: "Steffers"
Дата:
Сообщение: ...