unique & update

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: <pgsql-general(at)postgresql(dot)org>
Subject: unique & update
Date: 2002-01-29 12:38:04
Message-ID: 002801c1a8c1$cc24c1c0$aa0f5ac2@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
--------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Schafer 2002-01-29 12:41:16 Re: Multibyte encoding vs. SQL_ASCII and European
Previous Message Frank Joerdens 2002-01-29 12:03:45 Multibyte encoding vs. SQL_ASCII and European languages