Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3D33A9F97C9 for ; Fri, 10 Aug 2007 23:22:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 12455-06 for ; Fri, 10 Aug 2007 23:22:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from servidor58.suempresa.com (servidor58.suempresa.com [201.130.79.68]) by postgresql.org (Postfix) with ESMTP id 5F7299F97A8 for ; Fri, 10 Aug 2007 23:22:30 -0300 (ADT) Received: (qmail 2408 invoked from network); 10 Aug 2007 21:22:31 -0500 Received: from dsl-189-142-115-229.prod-infinitum.com.mx (HELO ?192.168.1.5?) (189.142.115.229) by servidor58.suempresa.com with SMTP; 10 Aug 2007 21:22:30 -0500 Subject: Re: Joining tables in two different databases? From: Julio Cesar =?ISO-8859-1?Q?S=E1nchez_Gonz=E1lez?= To: Chris Hoover Cc: Michael Goldner , pgsql-admin@postgresql.org In-Reply-To: <1d219a6f0708091208p6a17cafak83cb1d0beff4495d@mail.gmail.com> References: <1d219a6f0708091208p6a17cafak83cb1d0beff4495d@mail.gmail.com> Content-Type: text/plain; charset=utf-8 Date: Fri, 10 Aug 2007 21:22:20 -0500 Message-Id: <1186798940.6673.3.camel@andromeda> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.174 tagged_above=0 required=5 tests=AWL=0.173, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200708/127 X-Sequence-Number: 26458 El jue, 09-08-2007 a las 15:08 -0400, Chris Hoover escribió: > On 8/8/07, Michael Goldner wrote: > Is it possible to access tables in two different databases, > running on the > same server, from within psql? > yes it is, with dblink. follow next link: http://www.postgresql.org/docs/faqs.FAQ.html 4.17) How do I perform queries using multiple databases? There is no way to query a database other than the current one. Because PostgreSQL loads database-specific system catalogs, it is uncertain how a cross-database query should even behave. contrib/dblink allows cross-database queries using function calls. Of course, a client can also make simultaneous connections to different databases and merge the results on the client side. > > > Take a look at dblink in the contrib area. I think it will give you > what you are looking for. > > Chris -- Regards, Julio Cesar Sánchez González www.sistemasyconectividad.com.mx blog: http://darkavngr.blogspot.com --- Ahora me he convertido en la muerte, destructora de mundos. Soy la Muerte que se lleva todo, la fuente de las cosas que vendran.