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 ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match