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 76B9C53388 for ; Mon, 2 May 2005 12:37:26 -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 18315-03 for ; Mon, 2 May 2005 15:37:21 +0000 (GMT) Received: from pop.imatech.net (pop.imatech.net [81.255.215.227]) by svr1.postgresql.org (Postfix) with ESMTP id E8D3553225 for ; Mon, 2 May 2005 12:37:19 -0300 (ADT) Received: from imatech.net (81.255.215.227) by pop.imatech.net with MERCUR Mailserver (v4.03.13 MTI0LTIzMDYtNjkyMw==) for ; Mon, 2 May 2005 17:35:09 +0200 Received: from [200.200.200.185] ([195.6.193.141]) by imatech.net with Microsoft SMTPSVC(6.0.3790.1830); Mon, 2 May 2005 17:34:27 +0200 Message-ID: <427648E5.6080306@cerene.fr> Date: Mon, 02 May 2005 17:36:05 +0200 From: =?ISO-8859-1?Q?St=E9phane_RIFF?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Query two database at once Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 May 2005 15:34:27.0781 (UTC) FILETIME=[6D1EAF50:01C54F2C] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.067 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/15 X-Sequence-Number: 21328 Hi, I want to ewecute a query on two database like this : SELECT * FROM table01 T1, table02 T2 WHERE T1.gid=T2.gid AND T2.my_field='".$value."' The problem is that table01 is in a different database than table02 and i don't know how to telle postgresql to look in two db. Is there a solution other than execute two query ? Thanks