Re: Dual Primary keys

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Dual Primary keys
Дата
Msg-id 200402040931.46200.josh@agliodbs.com
обсуждение исходный текст
Ответ на Dual Primary keys  ("Bantamess" <bantamess@yahoo.co.uk>)
Список pgsql-novice
Janet,

> I also tried this:
> create table borrower(user_id int ,
> issn varchar(15),
> primary key user_id, issn);
> ERROR: parser: parse error at or near "user_id" at character 68

This is, I think, what you want.  However, you have a syntax error in your
primary key constraint declaration:

CONSTRAINT borrower_pk PRIMARY KEY (user_id, issn)

Also, both user_id and issn should be declared NOT NULL.

Overally, I suggest picking up an "introduction to SQL book", such as "SQL
Queries for Mere Mortals."

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Dual Primary keys
Следующее
От: "Bantamess"
Дата:
Сообщение: Dual Primary Keys