pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: postgresql@middaysomewhere.com
Subject: BUG #17558: 15beta2: Endless loop with UNIQUE NULLS NOT DISTINCT and INSERT ... ON CONFLICT
Date: Mon, 25 Jul 2022 01:04:06 +0000
Message-ID: <17558-3f6599ffcf52fd4a@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17558
Logged by:          Andrew Kesper
Email address:      postgresql@middaysomewhere.com
PostgreSQL version: Unsupported/Unknown
Operating system:   Debian 11 (buster)
Description:        

In PostgreSQL 15 beta, when I try to insert a NULL value which violates a
"UNIQUE NULLS NOT DISTINCT" constraint, PostgreSQL will get stuck in an
endless loop if the command includes an "ON CONFLICT" clause. 

CREATE TABLE test (val TEXT UNIQUE NULLS NOT DISTINCT);
INSERT INTO test (val) VALUES ('a') ON CONFLICT DO NOTHING; -- inserts 'a'
INSERT INTO test (val) VALUES ('a') ON CONFLICT DO NOTHING; -- does
nothing
INSERT INTO test (val) VALUES (NULL) ON CONFLICT DO NOTHING; -- inserts
NULL
INSERT INTO test (val) VALUES (NULL) ON CONFLICT DO NOTHING; --
unresponsive

PostgreSQL will max out the CPU, complain that the WAL is growing too fast,
consume all available disk space, then crash.



view thread (5+ messages)  latest in thread

Message-ID: <17558-3f6599ffcf52fd4a@postgresql.org>
Permalink:  ../17558-3f6599ffcf52fd4a@postgresql.org/
Also on:    postgresql.org/message-id/17558-3f6599ffcf52fd4a@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, postgresql@middaysomewhere.com
  Subject: Re: BUG #17558: 15beta2: Endless loop with UNIQUE NULLS NOT DISTINCT and INSERT ... ON CONFLICT
  In-Reply-To: <17558-3f6599ffcf52fd4a@postgresql.org>

* 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