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