Skip site navigation (1) Skip section navigation (2)

Dual Primary keys

From: "Bantamess" <bantamess(at)yahoo(dot)co(dot)uk>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Dual Primary keys
Date: 2004-02-04 15:15:45
Message-ID: 001601c3eb31$c2fea8e0$6501a8c0@HOMEWITHLINUX (view raw or flat)
Thread:
Lists: pgsql-novice
Hello can any body tell me how to code a table with dual primary keys? The table 'borrower' has two PKs each one has been used in other tables within the same schema as single PKs

Here is what I have tried:
create table borrower(user_id int primary key,
issn varchar(15) primary key);
Error: create table / primary key  multiple primary keys for table 'borrower' are not allowed.

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
and
create table borrower(user_id int ,
issn varchar(15), 
(primary key user_id, issn));
 ERROR: parser: parse error at or near "( " at character 56
thanks
Janet

Responses

pgsql-novice by date

Next:From: Bruno Wolff IIIDate: 2004-02-04 15:35:18
Subject: Re: Dual Primary keys
Previous:From: george youngDate: 2004-02-04 14:22:00
Subject: Re: pg_atoi error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group