Re: Unique indexes & constraints on partitioned tables
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-12-25T21:33:53Z
Lists: pgsql-hackers
Amit Langote wrote: > Have you considered what happens when ON CONFLICT code tries to depend on > such an index (a partitioned unique index)? Not yet, but it was on my list of things to fix. Thanks for working on it -- I'll be reviewing this soon. > +create table parted_conflict_test_2 partition of parted_conflict_test for values in (2); > +create unique index on parted_conflict_test (a); > +insert into parted_conflict_test values (1, 'a') on conflict (a) do nothing; > +insert into parted_conflict_test values (1, 'b') on conflict (a) do update set b = excluded.b; > +insert into parted_conflict_test values (1, 'b') on conflict (a) do update set b = excluded.b where parted_conflict_test.b = 'a'; > +select * from parted_conflict_test; > + a | b > +---+--- > + 1 | b > +(1 row) sweet. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Allow UNIQUE indexes on partitioned tables
- eb7ed3f30634 11.0 landed