From wweng@kencast.com Fri Jan 17 23:59:30 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A08274760DF for ; Fri, 17 Jan 2003 18:59:30 -0500 (EST) Received: from mta4.snet.net (mta4.snet.net [204.60.203.76]) by postgresql.org (Postfix) with ESMTP id 26AFB477507 for ; Fri, 17 Jan 2003 18:51:24 -0500 (EST) Received: from pop.snet.net (pop.snet.net [204.60.203.72]) by mta4.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id h0HNojDK015042 for ; Fri, 17 Jan 2003 18:50:46 -0500 (EST) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from monet (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with SMTP id h0HNpGc4026087 for ; Fri, 17 Jan 2003 18:51:17 -0500 (EST) Message-ID: <001601c2be83$59ebe420$5301a8c0@monet> From: "Wei Weng" To: Subject: Can I do this? Date: Fri, 17 Jan 2003 18:51:27 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0013_01C2BE59.70E81560" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/282 X-Sequence-Number: 11147 This is a multi-part message in MIME format. ------=_NextPart_000_0013_01C2BE59.70E81560 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I want to select some data out of database A, and insert them into database= B. Is it possible to do in one SQL query? Thanks Wei ------=_NextPart_000_0013_01C2BE59.70E81560 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
I want to select some data out of database A, and inser= t them=20 into database B. Is it possible to do in one SQL query?
 
Thanks
 
Wei
 
------=_NextPart_000_0013_01C2BE59.70E81560-- From pgman@candle.pha.pa.us Sat Jan 18 00:27:46 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3C6374760E5 for ; Fri, 17 Jan 2003 19:27:46 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id CD214477507 for ; Fri, 17 Jan 2003 19:19:53 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h0I0Jpp04437; Fri, 17 Jan 2003 19:19:51 -0500 (EST) From: Bruce Momjian Message-Id: <200301180019.h0I0Jpp04437@candle.pha.pa.us> Subject: Re: Can I do this? In-Reply-To: <001601c2be83$59ebe420$5301a8c0@monet> To: Wei Weng Date: Fri, 17 Jan 2003 19:19:51 -0500 (EST) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/284 X-Sequence-Number: 11149 See /contrib/dblink, or use an application that attaches to both databases, or use COPY somehow. --------------------------------------------------------------------------- Wei Weng wrote: > I want to select some data out of database A, and insert them into database B. Is it possible to do in one SQL query? > > Thanks > > Wei -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From josh@agliodbs.com Sat Jan 18 00:29:26 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6AE17476264 for ; Fri, 17 Jan 2003 19:29:26 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 8790C476763 for ; Fri, 17 Jan 2003 19:28:55 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2317977; Fri, 17 Jan 2003 16:29:00 -0800 Content-Type: text/plain; charset="windows-1252" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Wei Weng" , Subject: Re: Can I do this? Date: Fri, 17 Jan 2003 16:31:07 -0800 X-Mailer: KMail [version 1.4] References: <001601c2be83$59ebe420$5301a8c0@monet> In-Reply-To: <001601c2be83$59ebe420$5301a8c0@monet> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301171631.07223.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/283 X-Sequence-Number: 11148 Wei, > I want to select some data out of database A, and insert them into databa= se=20 B. Is it possible to do in one SQL query? >=20 No. Use a Perl script. --=20 -Josh Berkus Aglio Database Solutions San Francisco