pgsql: Simplify view-expansion code in rewriteHandler.c. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Simplify view-expansion code in rewriteHandler.c.
Date
Msg-id E1f7W2Z-0001mm-DE@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: List src/include/partitioning in src/include/Makefile
Next
From: Amit Langote
Date:
Subject: Re: pgsql: Reorganize partitioning code