pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andy S <gatekeeper.mail@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
Date: Fri, 13 Nov 2020 14:08:39 -0500
Message-ID: <393978.1605294519@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFAcjJPiyZ5H=3uEegOk9hen_+Q7hcOrrLEvrt6tdiM1rrchDA@mail.gmail.com>
References: <16714-dbf5759eba70bfe4@postgresql.org>
	<288078.1605283397@sss.pgh.pa.us>
	<CAFAcjJPiyZ5H=3uEegOk9hen_+Q7hcOrrLEvrt6tdiM1rrchDA@mail.gmail.com>

Andy S <gatekeeper.mail@gmail.com> writes:
> That's then either a docs bug. The documentation states:
>> For each individual row proposed for insertion, either the insertion
>> proceeds, or, if an *arbiter* constraint or index specified by
>> *conflict_target* is violated, the alternative *conflict_action* is taken

Yeah, but you did not specify a valid arbiter constraint.  ON CONFLICT is
not a get-out-of-jail-free card; it will not trap any error whatsoever,
only a detected unique-constraint violation.

What you probably want here is to declare (part_key1, part_key4)
as the primary key of the partitioned table, and use that in the
ON CONFLICT spec.  That will save you from having to make constraints
on the individual partitions, too.

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <393978.1605294519@sss.pgh.pa.us>
Permalink:  ../393978.1605294519@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/393978.1605294519@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gatekeeper.mail@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16714: INSERT ON CONFLICT DO UPDATE fails to infer constraint if it's not at top-level partition
  In-Reply-To: <393978.1605294519@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox