Received: from dune.krs.ru (dune.krs.ru [195.161.16.38]) by hub.org (8.8.8/8.7.5) with ESMTP id PAA13436; Thu, 23 Jul 1998 15:42:19 -0400 (EDT) Received: from krs.ru (localhost.krs.ru [127.0.0.1]) by dune.krs.ru (8.8.8/8.8.8) with ESMTP id DAA07176; Fri, 24 Jul 1998 03:41:23 +0800 (KRSS) (envelope-from vadim@krs.ru) Sender: root@dune.krs.ru Message-ID: <35B791E3.AF429A52@krs.ru> Date: Fri, 24 Jul 1998 03:41:23 +0800 From: Vadim Mikheev Organization: OJSC Rostelecom (Krasnoyarsk) X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) MIME-Version: 1.0 To: Lorenzo Huerta CC: pgsql-general@postgreSQL.org, pgsql-sql@postgreSQL.org Subject: Re: [GENERAL] Fwd: help with uniq index (fwd) References: <19980723185543.22328.rocketmail@send1d.yahoomail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lorenzo Huerta wrote: > > can you all help me with this: > > > is there a way to create a unique index on a field > > (in ver 6.3.1) and also > > have a single non-uniq value in that value, ie the NULL value? Why do you ask? Why don't you try first? vac=> create table t (x int); CREATE vac=> create unique index ti on t (x); CREATE vac=> insert into t values (1); INSERT 18444 1 vac=> insert into t values (1); ERROR: Cannot insert a duplicate key into a unique index vac=> insert into t values (null); INSERT 18446 1 vac=> insert into t values (null); INSERT 18447 1 vac=> insert into t values (null); INSERT 18448 1 Vadim