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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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