Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0F05C9F9BCE for ; Thu, 6 Sep 2007 05:37:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 65815-08 for ; Thu, 6 Sep 2007 05:37:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by postgresql.org (Postfix) with ESMTP id 3B1809F9BB4 for ; Thu, 6 Sep 2007 05:37:10 -0300 (ADT) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by pih-relay05.plus.net with esmtp (Exim) id 1ITCrB-0001P2-V1; Thu, 06 Sep 2007 09:37:01 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 84A45274054; Thu, 6 Sep 2007 09:16:29 +0100 (BST) Message-ID: <46DFB75D.2090105@archonet.com> Date: Thu, 06 Sep 2007 09:16:29 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: hu js CC: pgsql-sql@postgresql.org Subject: Re: How to use serial variable to insert into muiti-recrods? References: In-Reply-To: Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/57 X-Sequence-Number: 29270 hu js wrote: > run: > "CREATE TABLE xxx > ( > id serial NOT NULL, > name character varying > ); > insert into xxx select default values,place_name from air_bui;" insert into xxx (name) SELECT place_name FROM ... HTH -- Richard Huxton Archonet Ltd