Re: select into without creating new table

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: select into without creating new table
Date: 2002-10-21 14:23:35
Message-ID: 3DB45B3F.249.AE3E3A5@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 18 Oct 2002 at 13:44, Paul wrote:
> How can I select data from table into an existing table. I've redesigned
> some tables and thus want my data to be copied from the old table to the new
> one. Since the column order, names (and the number of columns) is not equal
> i thought of using:
>
> select column1,column2 into newtable from oldtable

Try insert into newtable select * from oldtable;

See insert syntax for more details..

HTH

Bye
Shridhar

--
lighthouse, n.: A tall building on the seashore in which the government
maintains a lamp and the friend of a politician.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2002-10-21 14:30:09 Re: referential integrity violation
Previous Message Tom Lane 2002-10-21 14:21:01 Re: Migrating from Informix to Postgre