Re: PRIMARY KEY and UNIQUE

From: Darren Ferguson <darren(at)crystalballinc(dot)com>
To: Erwin Ambrosch <ambre(at)ebutec(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEY and UNIQUE
Date: 2002-02-14 15:29:09
Message-ID: Pine.LNX.4.10.10202141028210.3159-100000@thread.crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If it is a primary key then it will automatically be UNIQUE.

You do not need the unique next to the VARCHAR in this situation

Darren

On Thu, 14 Feb 2002, Erwin Ambrosch 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gould 2002-02-14 15:30:42 Re: PRIMARY KEY and UNIQUE
Previous Message Erwin Ambrosch 2002-02-14 15:06:35 PRIMARY KEY and UNIQUE