Skip site navigation (1) Skip section navigation (2)

Re: Changing the Primary Key Column

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Michael Ewan <michael(dot)ewan(at)intel(dot)com>
Cc: pdxpug(at)postgresql(dot)org
Subject: Re: Changing the Primary Key Column
Date: 2011-02-24 01:13:23
Message-ID: 1298510003.14800.156.camel@jd-desktop (view raw or flat)
Thread:
Lists: pdxpug
On Wed, 2011-02-23 at 17:11 -0800, Michael Ewan wrote:
> 
> On 02/23/2011 05:09 PM, Rich Shepard wrote:
> > On Wed, 23 Feb 2011, Joshua D. Drake wrote:
> >
> >> alter table drop constraint
> >> alter table drop column
> >> alter table add primary key
> >>
> >> done
> >
> >     Thanks, Josh.
> >
> >     When I do this and follow with '\d water_well' I still see the first
> > column (sequence_no) with the not null constraint. Wonder why that didn't
> > drop when I specified the column name in the drop column command.
> 
> Did you COMMIT; ?

He would still see the change if it actually executed, even in a
transaction because of the isolation. Now if he disconnected and
reconnected or is looking at it in another terminal/session, it wouldn't
see it.

JD

> 

-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
Consulting, Training, Support, Custom Development, Engineering
http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt


In response to

Responses

pdxpug by date

Next:From: Rich ShepardDate: 2011-02-24 01:15:07
Subject: Re: Changing the Primary Key Column
Previous:From: Randal L. SchwartzDate: 2011-02-24 01:12:44
Subject: Re: Changing the Primary Key Column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group