how to select one column into another in same table? - Mailing list pgsql-general

From J.V.
Subject how to select one column into another in same table?
Date
Msg-id 4E8B4F62.5010308@gmail.com
Whole thread Raw
Responses Re: how to select one column into another in same table?  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
Currently I can select one column into another with two statements:

     alter table <table_name> add column id_old int;
     update <table_name> set id_old = id;

Is there a way to do this in one statement with a select into?  I have
tried various select statements but want the new column (with the same
data) to be in the same table and to have it execute much more quickly
that the two statements currently do.

thanks


J.V.

pgsql-general by date:

Previous
From: "J.V."
Date:
Subject: fail: alter table NOCHECK CONSTRAINT ALL;
Next
From: Scott Marlowe
Date:
Subject: Re: how to select one column into another in same table?