Tom Lane wrote:
Daniel Verite dan...@manitou-mail.org writes:
But still I wonder why there is that difference in behavior between NON
DEFERRABLE and DEFERRABLE INITIALLY IMMEDIATE, when the unique constraint
doesn't get deferred by using SET CONSTRAINTS.
In the first case, we get
Daniel Verite dan...@manitou-mail.org writes:
Tom Lane wrote:
1. Performance. The cost of #2 is very large, and the number of cases
where you actually need it is not.
Per Dean's explanation upthread, It looks like an additional cost for #2
would occur mostly when temporary conflicts
Dean Rasheed wrote:
So there is quite a bit of flexibility - you may choose to have the
constraint checked at any of these times:
- after each row (the default for NON DEFERRABLE constraints)
- after each statement (DEFERRABLE [INITIALLY IMMEDIATE])
- at the end of the transaction
2010/1/5 Roman Neuhauser neuhauser+pgsql-general#postgresql@sigpipe.cz:
# jayadevan.maym...@ibsplc.com / 2010-01-04 10:03:29 +0530:
This seems to work..
UPDATE x set i=i+1
from (select i as m from x order by m desc) y where x.i = y.m
Jayadevan
Thanks, that nicely achieves the
2010/1/6 Daniel Verite dan...@manitou-mail.org:
Dean Rasheed wrote:
So there is quite a bit of flexibility - you may choose to have the
constraint checked at any of these times:
- after each row (the default for NON DEFERRABLE constraints)
- after each statement (DEFERRABLE
Daniel Verite dan...@manitou-mail.org writes:
But still I wonder why there is that difference in behavior between NON
DEFERRABLE and DEFERRABLE INITIALLY IMMEDIATE, when the unique constraint
doesn't get deferred by using SET CONSTRAINTS.
In the first case, we get the after each row behavior
2010/1/4 Daniel Verite dan...@manitou-mail.org:
David Fetter wrote:
The DEFERRED uniqueness constraints in 8.5alpha3 fix this problem
That fix has a drawback: when the unique constraint is violated, the rest of
the transaction runs with data that is somehow corrupted, with duplicate
# jayadevan.maym...@ibsplc.com / 2010-01-04 10:03:29 +0530:
From: neuhauser+pgsql-general#postgresql@sigpipe.cz
this fails with duplicate key value:
CREATE TABLE x (
i INT NOT NULL UNIQUE
);
INSERT INTO x (i) VALUES (1), (2), (3);
UPDATE x SET i = i +
David Fetter wrote:
The DEFERRED uniqueness constraints in 8.5alpha3 fix this problem
That fix has a drawback: when the unique constraint is violated, the rest of
the transaction runs with data that is somehow corrupted, with duplicate
values being visible. It may be uneasy to predict
# scott.marl...@gmail.com / 2010-01-02 11:23:24 -0700:
On Sat, Jan 2, 2010 at 1:40 AM, Roman Neuhauser neuhau...@sigpipe.cz wrote:
# da...@fetter.org / 2009-12-31 08:04:58 -0800:
On Thu, Dec 31, 2009 at 10:52:20AM +0100,
neuhauser+pgsql-general#postgresql@sigpipe.cz wrote:
Hello,
On Sun, Jan 03, 2010 at 10:16:10AM +0100, Roman Neuhauser wrote:
# scott.marl...@gmail.com / 2010-01-02 11:23:24 -0700:
On Sat, Jan 2, 2010 at 1:40 AM, Roman Neuhauser neuhau...@sigpipe.cz
wrote:
# da...@fetter.org / 2009-12-31 08:04:58 -0800:
On Thu, Dec 31, 2009 at 10:52:20AM +0100,
Hi,
This seems to work..
UPDATE x set i=i+1
from (select i as m from x order by m desc) y where x.i = y.m
Jayadevan
From: neuhauser+pgsql-general#postgresql@sigpipe.cz
To: pgsql-general@postgresql.org
Date: 12/31/2009 09:15 PM
Subject:[GENERAL] set-level update fails
# da...@fetter.org / 2009-12-31 08:04:58 -0800:
On Thu, Dec 31, 2009 at 10:52:20AM +0100,
neuhauser+pgsql-general#postgresql@sigpipe.cz wrote:
Hello,
this fails with duplicate key value:
CREATE TABLE x (
i INT NOT NULL UNIQUE
);
INSERT INTO x (i) VALUES
On Sat, Jan 2, 2010 at 1:40 AM, Roman Neuhauser neuhau...@sigpipe.cz wrote:
# da...@fetter.org / 2009-12-31 08:04:58 -0800:
On Thu, Dec 31, 2009 at 10:52:20AM +0100,
neuhauser+pgsql-general#postgresql@sigpipe.cz wrote:
Hello,
this fails with duplicate key value:
CREATE TABLE
Hello,
this fails with duplicate key value:
CREATE TABLE x (
i INT NOT NULL UNIQUE
);
INSERT INTO x (i) VALUES (1), (2), (3);
UPDATE x SET i = i + 1;
are there any plans to make this work?
--
Roman Neuhauser
--
Sent via pgsql-general mailing list
2009/12/31 neuhauser+pgsql-general#postgresql.org
neuhauser+pgsql-general#postgresql@sigpipe.cz:
Hello,
this fails with duplicate key value:
CREATE TABLE x (
i INT NOT NULL UNIQUE
);
INSERT INTO x (i) VALUES (1), (2), (3);
UPDATE x SET i = i + 1;
are there any plans
On Thu, Dec 31, 2009 at 10:52:20AM +0100,
neuhauser+pgsql-general#postgresql@sigpipe.cz wrote:
Hello,
this fails with duplicate key value:
CREATE TABLE x (
i INT NOT NULL UNIQUE
);
INSERT INTO x (i) VALUES (1), (2), (3);
UPDATE x SET i = i + 1;
are there
17 matches
Mail list logo