"Karl O. Pinc" <[EMAIL PROTECTED]> wrote: > Hi, > > Postgresql 8.1. > > I'm trying to come up with a generic way > of inserting into a view, particularly regards > error testing and the generation of complicated > foreign keys. I don't seem to be having much luck. > > (I also want to update and delete, but haven't gotten > that far.) Before I mount too much of a reply, may I ask in particularwhy you are targeting views? Reason I ask is that I've gonethrough the same process and have worked out a generalapproach to implementing all biz logic in triggers.However, as the biz logic is defined in terms of tables, weattached all logic always to tables. When for whateverreason the user is going through a view, the rule sends itback to the base table where the biz logic takes care of itthere.This avoids attempting to redefine or recast the rules inthe context of any particular view.So that is why I am asking why in particular you are asking about views. > > I thought that, for inserts at least, I could write > a rule that called a function and have the function > do anything complicated, raise exceptions, etc. > But I get the error message shown below. > _________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.org