insert into help

From: Nicholas I <nicholas(dot)domnic(dot)i(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: insert into help
Date: 2010-09-22 07:32:28
Message-ID: AANLkTi=1-bAfOTtpkgrTGmDioKetTud2aKwBNup3_raE@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

i have two tables,
---------------------------------------------------------------
*table1

id type serial, name varchar;*
*--------------------------------------------------------------
table 2

name varchar;*
---------------------------------------------------------------

i want to insert the values of table 2 into table 1, with automatic id's.

insert into table1(select * from table2);

is not working, how can i append the data to table 1 with auto incremented
or nextval.

-Nicholas I

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Guillaume Lelarge 2010-09-22 07:35:20 Re: insert into help
Previous Message Adrian Johnson 2010-09-21 23:16:55 Re: Help with queries.