Re: strange behaviour of "CHECK ... IN (SELECT ...)" as constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strange behaviour of "CHECK ... IN (SELECT ...)" as constraint
Дата
Msg-id 23533.964071029@sss.pgh.pa.us
обсуждение исходный текст
Ответ на strange behaviour of "CHECK ... IN (SELECT ...)" as constraint  (Helge Bahmann <bahmann@math.tu-freiberg.de>)
Список pgsql-novice
Helge Bahmann <bahmann@math.tu-freiberg.de> writes:
>   CREATE TABLE ex2(name text, CHECK (name in (SELECT name FROM ex1)));

>   ERROR:  ExecEvalExpr: unknown expression type 108

I don't believe the constraint code knows how to cope with constraint
expressions that require planning :-(.

If you want to become a backend programming guru, a good path to
enlightenment would be to figure out how to fix that without
unacceptable performance penalties.

If you don't, I'd suggest embedding the SELECT in a plpgsql function.

            regards, tom lane

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

Предыдущее
От: Helge Bahmann
Дата:
Сообщение: strange behaviour of "CHECK ... IN (SELECT ...)" as constraint
Следующее
От: Boszormenyi Laszlo
Дата:
Сообщение: Get a row by it's number