Re: Create Table Unique problem... bug?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Mauro Bertoli <bertolima(at)yahoo(dot)it>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Create Table Unique problem... bug?
Date: 2003-05-28 14:51:07
Message-ID: 20030528145107.GA4890@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, May 28, 2003 at 15:34:41 +0200,
Mauro Bertoli <bertolima(at)yahoo(dot)it> wrote:
> INSERT INTO questiontypes (id,flags,label) values
> (2,null,'a');
>
> and re-insert it... I can!!!! Now there are two
> identical row, and UNIQUE??
> I think postgres must occur an error? Is it Ok?

This is how unique constraints work. Any null value is considered as
different from any other null value. If that isn't how you want things
to work, using some value other than null to represent whatever you
are using null to represent.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message papapep 2003-05-28 16:59:08 Re: Inserting data of two other tables [Now deleting ...]
Previous Message Crombleholme, Roy 2003-05-28 14:34:58 Getting stats out of postgresql