Re: add primary key

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "mikhail malamud" <mikhail(dot)malamud(at)drexel(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: add primary key
Date: 2001-03-13 18:18:59
Message-ID: 200103131818.f2DIIxG13018@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"mikhail malamud" wrote:
>I ve been trying to find an answer to this question but all in vain. Can
>someone pleease help me. How do you add a primary key constraint to an
>existing table.
>
>
>
>-----Original Message-----
>From: pgsql-novice-owner(at)postgresql(dot)org
>[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of mikhail malamud
>Sent: Saturday, March 10, 2001 10:55 PM
>To: pgsql-novice(at)postgresql(dot)org
>Subject: [NOVICE] add primary key
>
>
>ALTER TABLE Activity add
> CONSTRAINT PRIMARY KEY
> (
> ActivityId
> )
>What's wrong with this. How do I add primary key constraint.

The facility is not supported, even at 7.1

Dump your database with pg_dump, edit the dump file and reload it.

If the facility were supported, the command would be:

ALTER TABLE Activity ADD CONSTRAINT Activity PRIMARY KEY(ActivityId)

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Who is like Thee among the gods, O Lord? Who is like
Thee, majestic in holiness, awesome in praises,
working wonders?"
Exodus 15:11

Browse pgsql-novice by date

  From Date Subject
Next Message Brett W. McCoy 2001-03-13 18:38:00 Re: perl installation problem and installation of postgres from rpms
Previous Message Dax Duskin 2001-03-13 17:06:36 Re: perl installation problem and installation of postgres from rpms