X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E73D2D1B4AA for ; Tue, 13 Jan 2004 16:33:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 79926-01 for ; Tue, 13 Jan 2004 12:32:49 -0400 (AST) Received: from spoetnik.xs4all.nl (spoetnik.xs4all.nl [213.84.24.58]) by svr1.postgresql.org (Postfix) with ESMTP id 56B0ED1DF44 for ; Tue, 13 Jan 2004 12:32:41 -0400 (AST) Received: by spoetnik.xs4all.nl (Postfix, from userid 1000) id 259613E37; Tue, 13 Jan 2004 17:32:27 +0100 (CET) Date: Tue, 13 Jan 2004 17:32:26 +0100 From: Reinoud van Leeuwen To: Postgres-SQL Subject: Re: Copying rows between tables? Message-ID: <20040113173226.X66382@spoetnik.xs4all.nl> Mail-Followup-To: Postgres-SQL References: <1074011028.18994.18.camel@weaver.tuc.noao.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1074011028.18994.18.camel@weaver.tuc.noao.edu>; from swampler@noao.edu on Tue, Jan 13, 2004 at 09:23:48AM -0700 X-message-flag: Warning! The sender of this mail thinks you should use a more secure email client. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/112 X-Sequence-Number: 16505 On Tue, Jan 13, 2004 at 09:23:48AM -0700, Steve Wampler wrote: > > I know I can select from one table into a new table, but is > there a way to select from one table into an existing table > (aside from copying everything to a file, editing the file > and then copying from that file)? Without destroying existing > entries, of course... insert into desttable (col1, col2, col3) select col1, col2, col3 from sourcetable where somecol = somevalue; -- __________________________________________________ "Nothing is as subjective as reality" Reinoud van Leeuwen reinoud.v@n.leeuwen.net http://www.xs4all.nl/~reinoud __________________________________________________