Craig Ringer <craig@2ndquadrant.com> writes:
> I landed up adding a field to RangeTblEntry that keeps track of all the
> oids of relations row-security expanded to produce this RTE. When
> testing an RTE for row-security policy, this list is checked to see if
> the oid of the relation being expanded is already on the list. The list
> is copied to all RTEs inside sublinks after a relation is expanded using
> a query_tree_walker.
That's impossibly ugly, both as to the idea that an RTE is a mutable
data structure for this processing, and as to having to copy the list
around (meaning that you can't even claim to have one source of truth
for the state...)
regards, tom lane