Re: rules: evaluate inputs in advance - Mailing list pgsql-general

From Markus Schiltknecht
Subject Re: rules: evaluate inputs in advance
Date
Msg-id 1147443720.18683.31.camel@fotomarburg
Whole thread Raw
In response to Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: rules: evaluate inputs in advance  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
On Fri, 2006-05-12 at 15:57 +0200, Martijn van Oosterhout wrote:
> It's a known problem. It's also one of the reasons why triggers are
> recommended over rules. And it's not desirable behaviour.

Well, triggers cannot be used to create writeable views, can they?

> There have been discussions about the problems

Do you have some pointers here? I did not find relevant discussions in
the archives (of gmane.org)

> Yet no-one has come up with an
> alternative that covers the current uses...

As far as I know, the rewriter simply copies plan tree nodes. I thought
about inserting an 'evaluate-only-once' node which is linked from all
rules and points to the expression to evaluate (instead of copying the
complete explession and evaluating it several times in the executor).

Regards

Markus



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: rules: evaluate inputs in advance
Next
From: Tom Lane
Date:
Subject: Re: Connecting to PostgreSQL on Linux with windows