Re: insert into / select from / serial problem - Mailing list pgsql-sql

From Tom Lane
Subject Re: insert into / select from / serial problem
Date
Msg-id 5013.1124065991@sss.pgh.pa.us
Whole thread Raw
In response to insert into / select from / serial problem  ("tgh002" <arnulfh@gmail.com>)
List pgsql-sql
"tgh002" <arnulfh@gmail.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


pgsql-sql by date:

Previous
From: Luca Rasconi Master
Date:
Subject: Re: sum but not grouped by?
Next
From: Michael Fuhr
Date:
Subject: Re: trigger between to different database