Search Postgresql Archives

Re: Views: having a rule call a function vs. using a before trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Karl O. Pinc" <kop@xxxxxxxx> 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 particular
why you are targeting views? Reason I ask is that I've gone
through the same
process and have worked out a general
approach to implementing all biz logic
in triggers.

However, as the biz logic is defined in terms of tables, we
attached all logic always to tables. When for whatever
reason the user is
going through a view, the rule sends it
back to the base table where the biz
logic takes care of it
there.

This avoids attempting to redefine or
recast the rules in
the 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.
>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux