Re: 'UNIQUE'

From: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
To: Ben Clewett <B(dot)Clewett(at)roadrunner(dot)uk(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: 'UNIQUE'
Date: 2003-03-17 20:28:24
Message-ID: 1047932904.21399.6.camel@billy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • 'UNIQUE' at 2003-03-17 14:33:41 from Ben Clewett

Browse pgsql-novice by date

  From Date Subject
Next Message Ville Jungman 2003-03-17 23:15:30 Re: perl and postgresql
Previous Message douggorley 2003-03-17 16:55:11 Re: perl and postgresql