Re: add constraints to views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: add constraints to views
Дата
Msg-id 25410.1064078047@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: add constraints to views  (Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de>)
Список pgsql-general
Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de> writes:
> No, I mean that the view behaves like a table with the same columns as
> table, but that restricts to records on wich tag is set. To insert a
> record to this "special"  table it requires to have field1 set. In other
> words: A record of table is a record of view if tag is set. If tag is
> set, then field1 has also have to have a value. If tag is not set, it
> may have a value for field1, but will not show up in the view. Of course
> I could achive this be triggers, but I thought it could be possible to
> do via constraints on the view.

Constraints on a view are meaningless --- it has no real rows to
constrain.  Put the constraints on the underlying table.

            regards, tom lane

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

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: need for in-place upgrades
Следующее
От: Tom Lane
Дата:
Сообщение: Re: State of Beta 2