Re: incrementing without violating a constraint - Mailing list pgsql-general

From Michael P. Soulier
Subject Re: incrementing without violating a constraint
Date
Msg-id 20140120144001.GP23196@mitel.com
Whole thread Raw
In response to incrementing without violating a constraint  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Responses Re: incrementing without violating a constraint  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: incrementing without violating a constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 20/01/14 Michael P. Soulier said:

> This violates the uniquness constraint. Is there a way to say, turn off the
> constraint, run the update and then turn it back on?

Hmm. This didn't work.

tugdb=# SET CONSTRAINTS ALL DEFERRED;
SET CONSTRAINTS
tugdb=# update siptrunkroutingrules set rule_number = rule_number + 1;
ERROR:  duplicate key value violates unique constraint
"siptrunkroutingrules_unique_trunk_rule_number"

Mike

Attachment

pgsql-general by date:

Previous
From: "Michael P. Soulier"
Date:
Subject: incrementing without violating a constraint
Next
From: Andreas Kretschmer
Date:
Subject: Re: incrementing without violating a constraint