Search Postgresql Archives

how to select one column into another in same table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux