RE: Problem with subquery in CHECK constraint.

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема RE: Problem with subquery in CHECK constraint.
Дата
Msg-id 000901bfd0df$f57c1f20$2801007e@tpf.co.jp
обсуждение исходный текст
Ответ на Re: Problem with subquery in CHECK constraint.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
> -----Original Message-----
> From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
> Of Tom Lane
> 
> 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.
>

There seems to be more serious problems.
1) The constraint is not only for the defined table but also for referenced   tables in the subquery.
2) There should be some standard lock mechanism for the range restricted   by the subquery. 

I'm suspicious that we should/could implement constraints other than 
column constraints.   

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


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

Предыдущее
От: Bernie Huang
Дата:
Сообщение: Fetch an element in an array
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: counting distinct values