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 00:42:05
Message-ID: alpine.LNX.2.00.1102231640410.17955@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

On Wed, 23 Feb 2011, Darrell Fuhriman wrote:

> Why make it so hard?
>
> begin;
> SELECT * INTO new_table FROM old_table;
> DROP old_table;
> CREATE old_table ( new definition );
> INSERT INTO old_table SELECT col1,col2,col3,etc. FROM new_table;
> DROP new_table;
> commit;

Darrell,

Because, while I've winnowed the number of columns from 73 to 63, I don't
want to type all 63 column names interactively. :-)

But, I'm learning from all of you and really appreciate it!

Rich

In response to

Responses

Browse pdxpug by date

  From Date Subject
Next Message Rich Shepard 2011-02-24 00:43:20 Re: Changing the Primary Key Column
Previous Message Rich Shepard 2011-02-24 00:40:21 Re: Changing the Primary Key Column