Re: insert into / select from / serial problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "tgh002" <arnulfh(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: insert into / select from / serial problem
Date: 2005-08-15 00:33:11
Message-ID: 5013.1124065991@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"tgh002" <arnulfh(at)gmail(dot)com> writes:
> I am using a insert statement like:
> INSERT INTO newtable
> SELECT field1, field2 FROM anothertable

> newtable structure is: serial, varchar, varchar

> What syntax do I use to insert the serial field?

I think you want to just let it default, which you'd do with, say,

INSERT INTO newtable (fielda, fieldb)
SELECT field1, field2 FROM anothertable

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-08-15 03:12:50 Re: trigger between to different database
Previous Message santiago 2005-08-14 13:13:15 Re: catch an 'update where false' ?