Re: Changing the Primary Key Column

From: Michael Ewan <michael(dot)ewan(at)intel(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Re: Changing the Primary Key Column
Date: 2011-02-24 17:41:19
Message-ID: 4D66983F.60606@intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

On 02/24/2011 08:58 AM, Rich Shepard wrote:
> On Thu, 24 Feb 2011, Brian Kurle wrote:
>
>> For one of my tables, after performing a pg_dump, I see the following:
>>
>> ALTER TABLE ONLY action
>> ADD CONSTRAINT action_pkey PRIMARY KEY (transactionid);
>>
>> You would do something similar.
>
> Brian,
>
> Thanks very much for clarifying the syntax. While I read the doc page I
> did not have all necessary parts in the one statement. Now I understand how
> to add a new primary key.
>

If you are willing to use a GUI interface, pgadmin3 is very useful in
making these kind of changes and it shows you the syntax of the SQL
command it is using.

In response to

Responses

Browse pdxpug by date

  From Date Subject
Next Message Jeff Davis 2011-02-24 17:55:57 Re: Changing the Primary Key Column
Previous Message Rich Shepard 2011-02-24 16:58:31 Re: Changing the Primary Key Column