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