Re: uniquely indexing Celko's nested set model

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Richard Broersma Jr" <rabroersma(at)yahoo(dot)com>
Cc: "General PostgreSQL List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: uniquely indexing Celko's nested set model
Date: 2007-10-20 02:37:56
Message-ID: dcc563d10710191937v533605cbnebefd759254b07f6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/19/07, Richard Broersma Jr <rabroersma(at)yahoo(dot)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 way to 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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Atkins 2007-10-20 03:09:07 Re: uniquely indexing Celko's nested set model
Previous Message Scott Marlowe 2007-10-20 01:05:55 Re: ERROR: Could not access status of transaction ####