> My proposal in this WIP patch is to make it a bit clearer that > 'EXCLUDED' isn't a real relation. I played around with adding a > different rtekind, but that's too heavy a hammer. What I instead did was > to set relkind to composite - which seems to signal pretty well that > we're not dealing with a real relation. That immediately fixes the RLS > issue as fireRIRrules has the following check: > if (rte->rtekind != RTE_RELATION || > rte->relkind != RELKIND_RELATION) > continue; > It also makes it relatively straightforward to fix the system column > issue by adding an additional relkind check to scanRTEForColumn's system > column handling.
That works, but also precludes referencing 'oid' in a WITH OIDs table via EXCLUDED.oid - to me that looks correct since a to-be-inserted row can't yet have an oid assigned. Differing opinions? Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers