mirror of
https://github.com/postgres/postgres.git
synced 2025-12-24 06:01:07 +03:00
Revert "Allow ON CONFLICT .. DO NOTHING on a partitioned table."
This reverts commit 8355a011a0, which
turns out to have been a misguided effort. We can't really support
this in a partitioning hierarchy after all for exactly the reasons
stated in the documentation removed by that commit. It's still
possible to use ON CONFLICT .. DO NOTHING (or for that matter ON
CONFLICT .. DO UPDATE) on individual partitions if desired, but
but to allow this on a partitioned table implies that we have some
way of evaluating uniqueness across the whole partitioning
hierarchy, which is false.
Shinoda Noriyoshi noticed that the old code was crashing (which we
could fix, though not in a nice way) and Amit Langote realized
that this was indicative of a fundamental problem with the commit
being reverted here.
Discussion: http://postgr.es/m/ff3dc21d-7204-c09c-50ac-cf11a8c45c81@lab.ntt.co.jp
This commit is contained in:
@@ -3854,12 +3854,8 @@ ANALYZE measurement;
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Using the <literal>ON CONFLICT</literal> clause with partitioned tables
|
||||
will cause an error if <literal>DO UPDATE</literal> is specified as the
|
||||
alternative action, because unique or exclusion constraints can only be
|
||||
created on individual partitions. There is no support for enforcing
|
||||
uniqueness (or an exclusion constraint) across an entire partitioning
|
||||
hierarchy.
|
||||
<command>INSERT</command> statements with <literal>ON CONFLICT</>
|
||||
clause are currently not allowed on partitioned tables.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user