Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 890974760CD for ; Fri, 27 Sep 2002 13:15:25 -0400 (EDT) Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id D1FF847609B for ; Fri, 27 Sep 2002 13:15:24 -0400 (EDT) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id NAA11236; Fri, 27 Sep 2002 13:15:22 -0400 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma011234; Fri, 27 Sep 02 13:15:18 -0400 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id NAA27265; Fri, 27 Sep 2002 13:15:04 -0400 Message-ID: <3D949425.47649370@nsd.ca> Date: Fri, 27 Sep 2002 13:23:49 -0400 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-31 i686) X-Accept-Language: en MIME-Version: 1.0 To: Richard Huxton Cc: pgsql-sql@postgresql.org Subject: Re: Dublicates pairs in a table. References: <000201c25d90$87230c10$6500000a@IT000> <200209271354.54187.dev@archonet.com> <3D94849E.4A769993@nsd.ca> <200209271737.43262.dev@archonet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/386 X-Sequence-Number: 9663 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); > > ??? > > 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'); > > > > INSERT INTO test (c1,c2) VALUES('c','a'); > > Note Stephen Szabo's observation that I'd missed the obvious need for some > separator so ('a','ab') is different from ('aa','b') - Doh! > > - Richard Huxton