Re: UPSERT on view does not find constraint by name - Mailing list pgsql-hackers

From Tom Lane
Subject Re: UPSERT on view does not find constraint by name
Date
Msg-id 28328.1571388145@sss.pgh.pa.us
Whole thread Raw
In response to UPSERT on view does not find constraint by name  (Jeremy Finzel <finzelj@gmail.com>)
Responses Re: UPSERT on view does not find constraint by name
List pgsql-hackers
Jeremy Finzel <finzelj@gmail.com> writes:
> I'm not sure if this can be considered a bug or not, but it is perhaps
> unexpected.  I found that when using a view that is simply select * from
> table, then doing INSERT ... ON CONFLICT ON CONSTRAINT constraint_name on
> that view, it does not find the constraint and errors out.  But it does
> find the constraint if one lists the columns instead.

I'm confused by this report.  The view wouldn't have any constraints,
and experimenting shows that the parser won't let you name a
constraint of the underlying table here.  So would you provide a
concrete example of what you're talking about?

            regards, tom lane



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: generating catcache control data
Next
From: Michael Banck
Date:
Subject: Re: [Patch] Base backups and random or zero pageheaders