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

From Tom Lane
Subject Re: rules: evaluate inputs in advance
Date
Msg-id 14284.1147623813@sss.pgh.pa.us
Whole thread Raw
In response to Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Well, I notice that the SQL standard defines something called WITH, so
> what you want is something like:

> WITH OLD AS ( SELECT blah )
> DO
> ( UPDATE <rule1>
> ; DELETE <rule2> )

I think it'd be a mistake to assume that WITH would fix Markus'
complaint.  I haven't studied the spec in detail but I think that WITH
acts largely like a macro too.  It certainly doesn't have the behavior
of "evaluate this just once", as one of the prime uses for it is in
recursive query definition.

            regards, tom lane

pgsql-general by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8
Next
From: Tom Lane
Date:
Subject: Re: Cygwin psql with Windows native Postgres