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.