Andreas Fromm <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match