Re: PRIMARY KEY and UNIQUE

Поиск
Список
Период
Сортировка
От Liam DeMasi
Тема Re: PRIMARY KEY and UNIQUE
Дата
Msg-id 000001c1b571$f88badc0$0c00a8c0@netconnect12
обсуждение исходный текст
Ответ на Re: PRIMARY KEY and UNIQUE  (Andrew Gould <andrewgould@yahoo.com>)
Ответы Re: PRIMARY KEY and UNIQUE
Список pgsql-general
Andrew,

I thought that just by declaring the field the Primary Key makes it
automatically NOT NULL and UNIQUE?
Am I wrong?

Liam

>-----Original Message-----
>From: pgsql-general-owner@postgresql.org
>[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Andrew Gould
>Sent: Thursday, February 14, 2002 10:31 AM
>To: ambre@ebutec.com; pgsql-general@postgresql.org
>Subject: Re: [GENERAL] PRIMARY KEY and UNIQUE
>
>
>--- Erwin Ambrosch <ambre@ebutec.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
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to
>majordomo@postgresql.org)
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Gould
Дата:
Сообщение: Re: PRIMARY KEY and UNIQUE
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: TPC-H