X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0432D52C5F for ; Wed, 10 Aug 2005 00:04:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82260-01 for ; Wed, 10 Aug 2005 03:04:03 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0F9D352C53 for ; Wed, 10 Aug 2005 00:04:01 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 9F8163095A; Wed, 10 Aug 2005 05:13:47 +0200 (MET DST) From: "tgh002" X-Newsgroups: pgsql.sql Subject: insert into / select from / serial problem Date: 9 Aug 2005 20:03:47 -0700 Organization: http://groups.google.com Lines: 15 Message-ID: <1123643026.939110.310310@g47g2000cwa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g47g2000cwa.googlegroups.com; posting-host=68.228.72.103; posting-account=ldVYcg0AAACZET6hkNUT3F4pStfcvxON To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200508/81 X-Sequence-Number: 22309 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? Ive tried something like: INSERT INTO newtable SELECT nextval('newtable_id_seq'), field1, field2 FROM anothertable but that doesnt work Any ideas? Greatly appreciated!