Re: Changing the Primary Key Column

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Re: Changing the Primary Key Column
Date: 2011-02-24 15:59:15
Message-ID: alpine.LNX.2.00.1102240754390.4006@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

On Thu, 24 Feb 2011, Brent Dombrowski wrote:

> 'not null' is a column constraint, not the table constraint. Look for the
> table constraint at the bottom of the table description. It will likely be
> something like table_pkey. Here is a sample from a test database I have:

Brent,

Sonofagun! I totally missed this by being too close to the problem. Yes,
the table key was water_well_pkey.

Now that I dropped that key and the sequence_no column, what is the
correct syntax to add the primary key constraint to the now first column,
well_log? Trying to follow the 9.1 alter table page:

nevada-# alter table water_well add well_log_pkey
nevada-# commit;
ERROR: syntax error at or near "table"
LINE 2: alter table water_well add well_log_pkey
^
Thanks,

Rich

In response to

Browse pdxpug by date

  From Date Subject
Next Message Brian Kurle 2011-02-24 16:33:35 Re: Changing the Primary Key Column
Previous Message Brian Kurle 2011-02-24 15:56:33 Re: Changing the Primary Key Column