Re: [BUGS] BUG #14596: False primary/unique key constraint violations - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14596: False primary/unique key constraint violations
Date
Msg-id 963.1490197297@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14596: False primary/unique key constraint violations  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [BUGS] BUG #14596: False primary/unique key constraint violations
List pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Mar 22, 2017 at 7:45 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... Be aware that this can be
>> significantly slower than immediate uniqueness checking.

> Given that the default SET CONSTRAINT behavior is IMMEDIATE, and that
> triggers are defined DEFERRABLE, what harm would there be to default to the
> standard mandated behavior noted above?

The performance hit is one very large problem.  Another is that we don't
support using deferrable indexes for purposes such as foreign keys,
which means that

    create table x (f1 int primary key);
    create table y (f1 int references x);

would fail if "primary key" defaulted to meaning "deferrable".  So the
standards noncompliance would just move somewhere else.

            regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Rasmus Schultz
Date:
Subject: Re: [BUGS] BUG #14596: False primary/unique key constraint violations
Next
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] BUG #14596: False primary/unique key constraint violations