X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EB9A55320A for ; Sat, 23 Apr 2005 02:20:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17947-10 for ; Sat, 23 Apr 2005 05:19:53 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 0C80052948 for ; Sat, 23 Apr 2005 02:19:52 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j3N5JhcD035936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Apr 2005 23:19:45 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j3N5JhYs096586; Fri, 22 Apr 2005 23:19:43 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j3N5JhgM096585; Fri, 22 Apr 2005 23:19:43 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 22 Apr 2005 23:19:43 -0600 From: Michael Fuhr To: Art - Feping Cc: "'pgsql-sql@postgresql.org'" Subject: Re: How to select from many database ?? Message-ID: <20050423051943.GA96539@winnie.fuhr.org> References: <329EE23F2E3C9843B969AE66CDCB69C902C632@hmu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <329EE23F2E3C9843B969AE66CDCB69C902C632@hmu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/350 X-Sequence-Number: 21243 On Tue, Apr 19, 2005 at 10:13:52AM +0700, Art - Feping wrote: > > i want to select from many databases, for example , i want to select table > master in database A, and table master in database B. > can i do it like this : " select * from A.Master, B.Master " just like > in SQL Server ?? PostgreSQL doesn't directly support queries to multiple databases, but see contrib/dblink for a way to do it. See also the third-party dbi-link module. http://pgfoundry.org/projects/dbi-link -- Michael Fuhr http://www.fuhr.org/~mfuhr/