UPSERT on view does not find constraint by name

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: UPSERT on view does not find constraint by name
Date: 2019-10-17 17:49:38
Message-ID: CAMa1XUhaGQugY9yWboGXNzi+tefqC6YFmD0X04Sc8xNVQXunFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 did not find any mention of this specifically in the docs, or any
discussion on this topic after a brief search, and I have already asked my
stakeholder to change to using the column list as better practice anyway.
But in any case, I wanted to know if this is a known issue or not.

Thanks!
Jeremy

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2019-10-17 18:00:15 Non working timeout detection in logical worker
Previous Message Laurenz Albe 2019-10-17 17:05:57 Re: Can you please tell us how set this prefetch attribute in following lines.