1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Revert "Get rid of the "new" and "old" entries in a view's rangetable."

This reverts commit 1b4d280ea1.
It's broken the buildfarm members that run cross-version-upgrade tests,
because they're not prepared to deal with cosmetic differences between
CREATE VIEW commands emitted by older servers and HEAD.  Even if we had
a solution to that, which we don't, it'd take some time to roll it out
to the affected animals.  This improvement isn't valuable enough to
justify addressing that problem on an emergency basis, so revert it
for now.
This commit is contained in:
Tom Lane
2023-01-11 22:56:34 -05:00
parent 5a26c7b310
commit f0e6d6d3c9
34 changed files with 890 additions and 774 deletions

View File

@ -633,6 +633,13 @@ checkRuleResultList(List *targetList, TupleDesc resultDesc, bool isSelect,
* setRuleCheckAsUser
* Recursively scan a query or expression tree and set the checkAsUser
* field to the given userid in all RTEPermissionInfos of the query.
*
* Note: for a view (ON SELECT rule), the checkAsUser field of the OLD
* RTE entry's RTEPermissionInfo will be overridden when the view rule is
* expanded, and the checkAsUser for the NEW RTE entry's RTEPermissionInfo is
* irrelevant because its requiredPerms bits will always be zero. However, for
* other types of rules it's important to set these fields to match the rule
* owner. So we just set them always.
*/
void
setRuleCheckAsUser(Node *node, Oid userid)