Re: PRIMARY KEY and UNIQUE

From: Andrew Gould <andrewgould(at)yahoo(dot)com>
To: ambre(at)ebutec(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEY and UNIQUE
Date: 2002-02-14 15:30:42
Message-ID: 20020214153042.54752.qmail@web13405.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Erwin Ambrosch <ambre(at)ebutec(dot)com> wrote:
> Hi,
>
> I have a such a table.
>
> CREATE TABLE int_article (
> name VARCHAR(12) UNIQUE
> headline TEXT,
> summary TEXT,
> main TEXT,
> footer TEXT,
> PRIMARY KEY (name)
> );
>
> Is the UNIQUE constraint neccessary, because if have
> specified the column
> name to be the primary key.
>
> Thanks in advance
> Erwin

No; but if you eliminate 'UNIQUE', you'll need to
replace it with 'NOT NULL'.

Andrew Gould

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2002-02-14 16:03:13 Re: TPC-H
Previous Message Darren Ferguson 2002-02-14 15:29:09 Re: PRIMARY KEY and UNIQUE