Re: REINDEX (CONCURRENTLY) TABLE handles DEFERRED constraints as IMMEDIATE while processing

From: Nitin Motiani <nitinmotiani(at)google(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Dag Lem <dag(at)nimrod(dot)no>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: REINDEX (CONCURRENTLY) TABLE handles DEFERRED constraints as IMMEDIATE while processing
Date: 2026-07-20 17:41:25
Message-ID: CAH5HC97JOgdmOWFGkL8AW6BdYHwWfm+ngcHp6j7uo6bya1kgeQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jul 20, 2026 at 9:40 PM Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> On 2026-Jun-05, Dag Lem wrote:
>
> > While processing, "REINDEX (CONCURRENTLY) TABLE table_name" temporarily
> > treats the DEFERRED constraints as IMMEDIATE, causing transactions to fail
> > with errors on the form 'ERROR: duplicate key value violates unique
> > constraint "uq_constraint_name"'.
>
> I would say that this is clearly an oversight.
>

Hi,

I have proposed a patch for this on pgsql-hackers. Please take a look.
It can be found at
https://www.postgresql.org/message-id/CAH5HC97JmjPpgiQOqW9xm8qXhNiu7zZ1Qh%2BFfhEESJuDv69kuQ%40mail.gmail.com.

Thanks & Regards,
Nitin Motiani
Google

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Álvaro Herrera 2026-07-20 16:10:10 Re: REINDEX (CONCURRENTLY) TABLE handles DEFERRED constraints as IMMEDIATE while processing