Re: Unique indexes & constraints on partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Unique indexes & constraints on partitioned tables
Date
Msg-id 20171225213353.oy3umayus3nay7wa@alvherre.pgsql
Whole thread Raw
In response to Re: Unique indexes & constraints on partitioned tables  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List 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


pgsql-hackers by date:

Previous
From: Edson Carlos Ericksson Richter
Date:
Subject: Re: Stand by server (9.6.6) with corrupt file
Next
From: Erik Rijkers
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions