I wrote: > Robert Haas <robertmh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers