pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mihai Barbos <barbos@moon.ro>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@hub.org
Subject: Re: [SQL] UNIQUE constraint
Date: Sat, 21 Aug 1999 18:01:02 +0300
Message-ID: <000201beed47$f7dbf140$4a8823d4@gigell> (raw)

My fault, the correct situation is
create table TEST    (
    testkey    something    PRIMARY KEY,
    testval    something    UNIQUE,
         .....................
);

PRIMARY KEY works OK, but UNIQUE is ignored.

-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mihai Barbos <barbos@moon.ro>
Cc: pgsql-sql@hub.org <pgsql-sql@hub.org>
Date: Thursday, August 12, 1999 4:25 PM
Subject: Re: [SQL] UNIQUE constraint


>"Mihai Barbos" <barbos@moon.ro> writes:
>> Maybe I haven't looked in the roght place but here's my problem:
>> I've upgraded to 6.5 and I'm trying to use UNIQUE, something like:
>> create table TEST    (
>>         testval    something    UNIQUE,
>>         .....................,
>> );
>> In 6.4.2 it worked OK, but now it seems it has no effect. Is there any
>> problem with UNIQUE ?
>
>I don't see any:
>
>create table TEST    (
>testval    int4 UNIQUE
>);
>NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'test_testval_key'
for table 'test'
>CREATE
>insert into test values (1);
>INSERT 283276 1
>insert into test values (1);
>ERROR:  Cannot insert a duplicate key into a unique index
>
>You're going to have to be more specific about what problem you
>are observing.
>
> regards, tom lane
>




view thread (8+ messages)  latest in thread

Message-ID: <000201beed47$f7dbf140$4a8823d4@gigell>
Permalink:  ../000201beed47$f7dbf140$4a8823d4@gigell/
Also on:    postgresql.org/message-id/000201beed47$f7dbf140$4a8823d4@gigell

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barbos@moon.ro, tgl@sss.pgh.pa.us, pgsql-sql@hub.org
  Subject: Re: [SQL] UNIQUE constraint
  In-Reply-To: <000201beed47$f7dbf140$4a8823d4@gigell>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox