Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Jean-Luc Lachance
Oh, sorry I missed that. Still if C1 and C2 are interchangable, a rule could force C1 <= C2 and swap them if necessary. Richard Huxton wrote: > > On Friday 27 Sep 2002 5:17 pm, Jean-Luc Lachance wrote: > > What's wrong with > > CREATE UNIQUE INDEX foo_both_uniq ON foo(a,b); > > ??? > > Becau

Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Richard Huxton
On Friday 27 Sep 2002 5:17 pm, Jean-Luc Lachance wrote: > What's wrong with > CREATE UNIQUE INDEX foo_both_uniq ON foo(a,b); > ??? Because he specifically wanted values of ('a','b') and ('b','a') to be treated as equivalent (see quote). > > > INSERT INTO test (c1,c2) VALUES('a','c'); > > >

Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Stephan Szabo
On Fri, 27 Sep 2002, Richard Huxton wrote: > On Wednesday 25 Sep 2002 2:10 am, Kevin Houle wrote: > > I have the same issue with a table that currently holds well > > over 600,000 rows. The case you left out is this: > > > > INSERT INTO test (c1,c2) VALUES('a','c'); > > INSERT INTO test (c1,

Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Jean-Luc Lachance
What's wrong with CREATE UNIQUE INDEX foo_both_uniq ON foo(a,b); ??? Richard Huxton wrote: > > On Wednesday 25 Sep 2002 2:10 am, Kevin Houle wrote: > > I have the same issue with a table that currently holds well > > over 600,000 rows. The case you left out is this: > > > > INSERT INTO test

Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Richard Huxton
On Wednesday 25 Sep 2002 2:10 am, Kevin Houle wrote: > I have the same issue with a table that currently holds well > over 600,000 rows. The case you left out is this: > > INSERT INTO test (c1,c2) VALUES('a','c'); > INSERT INTO test (c1,c2) VALUES('c','a'); > > I want that to fail, but I haven

Re: [SQL] Dublicates pairs in a table.

2002-09-27 Thread Kevin Houle
Ries van Twisk wrote: > I have a small question which I could not clearly find in the postgreSQL > manual. > > if I create this table and index > CRAEATE TABLE test ( > id SERIAL, > c1 VARCHAR(32), > c2 VARCHAR(32), > c3 VARCHAR(32) > ); > > CREATE UN

Re: [SQL] Dublicates pairs in a table.

2002-09-17 Thread Richard Huxton
On Tuesday 17 Sep 2002 7:36 am, Ries van Twisk wrote: > Richard, > > do you suggest using a stored procedure to handle this? I do expect that > the table will be large (for me large is a around 1-2 records, the > table as more columns but I only need the restriction on c1 & c2) but I > don

Re: [SQL] Dublicates pairs in a table.

2002-09-16 Thread Ries van Twisk
> Aan: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Onderwerp: Re: [SQL] Dublicates pairs in a table. > > > On Monday 16 Sep 2002 3:51 pm, Ries van Twisk wrote: > > Dear guys/girls, > > > > I have a small question which I could not clearly find in > the postgreSQL >