Re: ON CONFLICT issues around whole row vars, - Mailing list pgsql-hackers

From Andres Freund
Subject Re: ON CONFLICT issues around whole row vars,
Date
Msg-id 20151003112136.GB3323@alap3.anarazel.de
Whole thread Raw
In response to Re: ON CONFLICT issues around whole row vars,  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
> 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



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP: Rework access method interface
Next
From: Petr Jelinek
Date:
Subject: Re: WIP: Rework access method interface