From yudie@axiontech.com Fri Jul 18 20:49:58 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id D39E7CCE04 for ; Fri, 18 Jul 2003 20:49:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 68175-09 for ; Fri, 18 Jul 2003 20:50:11 +0000 (GMT) Received: from axiontech.com (unknown [216.52.172.74]) by svr1.postgresql.org (Postfix) with SMTP id 2A87CCCE02 for ; Fri, 18 Jul 2003 17:49:39 -0300 (ADT) Received: (qmail 28623 invoked from network); 18 Jul 2003 20:44:56 -0000 Received: from unknown (HELO yudie) (192.168.1.132) by mail.axiontech.com (192.168.1.6) with SMTP; 18 Jul 2003 20:44:55 -0000 Message-ID: <003101c34d6d$cb199010$8401a8c0@yudie> From: "Yudie" To: Subject: how to copy table to another database? Date: Fri, 18 Jul 2003 15:47:13 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002A_01C34D43.DB3E8100" 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 amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50 X-Spam-Level: X-Archive-Number: 200307/259 X-Sequence-Number: 14373 This is a multi-part message in MIME format. ------=_NextPart_000_002A_01C34D43.DB3E8100 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Anyone know how the procedure or commands to copy table to another database. or querying from another database if possible? thank you yudie ------=_NextPart_000_002A_01C34D43.DB3E8100 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
Anyone know how the procedure or commands to copy table to anot= her=20 database.
or querying from another database if possible?

thank=20 you

yudie
------=_NextPart_000_002A_01C34D43.DB3E8100-- From scott.marlowe@ihs.com Fri Jul 18 21:08:18 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 1E0E0CCE0E for ; Fri, 18 Jul 2003 21:08:18 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 15590-10 for ; Fri, 18 Jul 2003 21:08:48 +0000 (GMT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 84D37CCE0C for ; Fri, 18 Jul 2003 18:08:16 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h6IL7OSZ011264; Fri, 18 Jul 2003 15:07:24 -0600 (MDT) Date: Fri, 18 Jul 2003 14:58:48 -0600 (MDT) From: "scott.marlowe" To: Yudie Cc: Subject: Re: how to copy table to another database? In-Reply-To: <003101c34d6d$cb199010$8401a8c0@yudie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/261 X-Sequence-Number: 14375 On Fri, 18 Jul 2003, Yudie wrote: > Hi, > Anyone know how the procedure or commands to copy table to another database. > or querying from another database if possible? If you want to copy a table from one db to another, you can use this: pg_dump dbname -t tablename |psql dbname -e If you want cross database queries, look in the /contrib/dblink dir in the tarball of postgresql From dmitry@openratings.com Fri Jul 18 21:06:19 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id B07C7CCDC1 for ; Fri, 18 Jul 2003 21:06:19 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 82885-07 for ; Fri, 18 Jul 2003 21:06:40 +0000 (GMT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id 06919CBA17 for ; Fri, 18 Jul 2003 18:06:08 -0300 (ADT) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38QM40NC; Fri, 18 Jul 2003 17:06:37 -0400 Message-ID: <3F18616E.60407@openratings.com> Date: Fri, 18 Jul 2003 17:06:54 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yudie Cc: pgsql-sql@postgresql.org Subject: Re: how to copy table to another database? References: <003101c34d6d$cb199010$8401a8c0@yudie> In-Reply-To: <003101c34d6d$cb199010$8401a8c0@yudie> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/260 X-Sequence-Number: 14374 Yudie wrote: > Hi, > Anyone know how the procedure or commands to copy table to another > database. > or querying from another database if possible? > > thank you > > yudie Something like this, perhaps? psql -d first_database -c '\copy mytable to stdout' | psql -d second_database -c '\copy mytable from stdin' I hope, it helps... Dima