Re: uniquely indexing Celko's nested set model - Mailing list pgsql-general

From Scott Marlowe
Subject Re: uniquely indexing Celko's nested set model
Date
Msg-id dcc563d10710191937v533605cbnebefd759254b07f6@mail.gmail.com
Whole thread Raw
In response to uniquely indexing Celko's nested set model  (Richard Broersma Jr <rabroersma@yahoo.com>)
Responses Re: uniquely indexing Celko's nested set model  (Steve Atkins <steve@blighty.com>)
Re: uniquely indexing Celko's nested set model  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-general
On 10/19/07, Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> Is it possible to constraint both the LEFT and RIGHT fields of a record to use the same index?  I am looking for a
wayto ensure for all LEFTs and RIGHTs in a table, that is it is impossible for any LEFT or RIGHT to have to same value. 

a check constraint ought to do it

check (field1<>field2)

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: ERROR: Could not access status of transaction ####
Next
From: Steve Atkins
Date:
Subject: Re: uniquely indexing Celko's nested set model