Re: UPSERT on view does not find constraint by name

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: UPSERT on view does not find constraint by name
Date: 2019-10-18 08:42:25
Message-ID: 28328.1571388145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeremy Finzel <finzelj(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Banck 2019-10-18 09:05:52 Re: [Patch] Base backups and random or zero pageheaders
Previous Message John Naylor 2019-10-18 07:51:55 Re: generating catcache control data