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

Changing primary keys

From: Carol Cheung <cacheung(at)consumercontact(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Changing primary keys
Date: 2006-09-27 19:54:59
Message-ID: 451AD713.1070103@consumercontact.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

The table 'house' was created with the below code (partial)

CREATE TABLE house (
   house_id bigserial unique not null,
   phone bigint not null,
   address varchar(75) not null,
   primary key(phone, address)
);

My question is how can I switch the primary key from (phone, address) to 
house_id, now that the table is created and records have been inserted.

Thanks,
C

Responses

pgsql-novice by date

Next:From: Richard Broersma JrDate: 2006-09-27 20:04:52
Subject: Re: Changing primary keys
Previous:From: developer_studentDate: 2006-09-27 18:18:58
Subject: Re: Postgre cannot delete from a table

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