unique & update - Mailing list pgsql-general

From Ben-Nes Michael
Subject unique & update
Date
Msg-id 002801c1a8c1$cc24c1c0$aa0f5ac2@canaan.co.il
Whole thread Raw
Responses Re: unique & update  (Frank Schafer <frank.schafer@setuza.cz>)
Re: unique & update  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Hi All

Im into SQL trees trying to work with CELKO way to do it:
http://www.intelligententerprise.com/001020/celko.shtml

The problem is that if I try to add a new descendent which is not the most
right sibling I get UNIQUE error.

This occur ( if im right ) when the update try to update the lft column
which is UNIQUE

Example of table:

CREATE TABLE areas (
lft INT UNIQUE
);

I inserted 3 rows with value: 1, 2, 3

now im trying to update:
update areas set lft = lft +1;

Then I get the UNIQUE problem.

Is there a way to do UNIQUE check after the whole table got updated ?
If not, any ideas to walk around the problem ?

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------



pgsql-general by date:

Previous
From: Frank Schafer
Date:
Subject: Re: Multibyte encoding vs. SQL_ASCII and European
Next
From: Thomas Lockhart
Date:
Subject: Re: problem with to_char