Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order
Date
Msg-id 6562.1256573195@sss.pgh.pa.us
Whole thread Raw
In response to Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order
List pgsql-hackers
I wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Could the desired behavior be obtained using a CTE?

> Nope, we push FOR UPDATE into WITHs too.  I don't really see any way to
> deal with this without some sort of semantic changes.

... although on reflection, I'm not sure *why* we push FOR UPDATE into
WITHs.  That seems a bit antithetical to the position we've evolved that
WITH queries are executed independently of the outer query.

If we removed that bit of behavior, which hopefully is too new for much
code to depend on, then the old FOR-UPDATE-last behavior could be
attained via a WITH.  And we'd not have to risk touching the interaction
between plain subqueries and FOR UPDATE, which is something that seems
much more likely to break existing apps.

That seems like a reasonable compromise to me ... any objections?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parsing config files in a directory
Next
From: "David E. Wheeler"
Date:
Subject: Re: [ANNOUNCE] PostgreSQL 8.5alpha2 Now Available