pgsql: Simplify view-expansion code in rewriteHandler.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify view-expansion code in rewriteHandler.c.
Date: 2018-04-15 01:01:11
Message-ID: E1f7W2Z-0001mm-DE@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify view-expansion code in rewriteHandler.c.

In the wake of commit 50c6bb022, it's not necessary for ApplyRetrieveRule
to have a forUpdatePushedDown parameter. By the time control gets here for
any given view-referencing RTE, we should already have pushed down the
effects of any FOR UPDATE/SHARE clauses affecting the view from outer query
levels. Hence if we don't find a RowMarkClause at the current query level,
that's sufficient proof that there is no outer one either. This in turn
means we need no forUpdatePushedDown parameter for fireRIRrules.

I wonder whether we oughtn't also revert commit cba2d2717, since it now
seems likely that that was band-aiding around the bad effects of doing
FOR UPDATE pushdown and view expansion in the wrong order. However,
in the absence of evidence that the current coding of markQueryForLocking
is actually buggy (i.e. missing RTEs it ought to mark), it seems best to
leave it alone.

Discussion: https://postgr.es/m/24db7b8f-3de5-e25f-7ab9-d8848351d42c@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49ac4039b28ec04ec0329b13bbb1baa6e94c86b7

Modified Files
--------------
src/backend/rewrite/rewriteHandler.c | 45 +++++++++++++++++-------------------
1 file changed, 21 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2018-04-15 03:00:37 Re: pgsql: Reorganize partitioning code
Previous Message Alvaro Herrera 2018-04-15 00:35:46 pgsql: List src/include/partitioning in src/include/Makefile