Re: 'UNIQUE' - Mailing list pgsql-novice

From Nabil Sayegh
Subject Re: 'UNIQUE'
Date
Msg-id 1047932904.21399.6.camel@billy
Whole thread Raw
In response to 'UNIQUE'  (Ben Clewett <B.Clewett@roadrunner.uk.com>)
List pgsql-novice
Am Mon, 2003-03-17 um 15.33 schrieb Ben Clewett:

> Does 'UNIQUE' allow multiple 'NULL' entries?
>
> Ie:
>
> key_foo
> -------
>    1
>    2
>    NULL
>    9
>    8
>    NULL
>    4
>    NULL


test=# CREATE TEMP TABLE a (id int unique);
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'a_id_key' for
table '
a'
CREATE TABLE
test=# INSERT INTO a values (1);
INSERT 29440 1
test=# INSERT INTO a values (2);
INSERT 29441 1
test=# INSERT INTO a values (null);
INSERT 29442 1
test=# INSERT INTO a values (9);
INSERT 29443 1
test=# INSERT INTO a values (8);
INSERT 29444 1
test=# INSERT INTO a values (null);
INSERT 29445 1
test=# INSERT INTO a values (4);
INSERT 29446 1
test=# INSERT INTO a values (null);
INSERT 29447 1
test=# SELECT * from a;
 id
----
  1
  2

  9
  8

  4

(8 rows)

apparently it does.

cu
--
 e-Trolley Sayegh & John, Nabil Sayegh
 Tel.: 0700 etrolley /// 0700 38765539
 Fax.: +49 69 8299381-8
 PGP : www.e-trolley.de


pgsql-novice by date:

Previous
From: douggorley@shaw.ca
Date:
Subject: Re: perl and postgresql
Next
From: "Ville Jungman"
Date:
Subject: Re: perl and postgresql