Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BA7A8475AA1 for ; Sat, 16 Nov 2002 05:40:00 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 2AD4747580B for ; Sat, 16 Nov 2002 05:40:00 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id B07CF43A3FD; Sat, 16 Nov 2002 05:39:59 -0500 (EST) From: "LR" X-Newsgroups: comp.databases.postgresql.sql References: <20021112141843.GA27903@wolff.to> Subject: Re: execute a query in an other db Date: Sat, 16 Nov 2002 11:43:09 +0100 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <3dd6207d_1@news.bluewin.ch> Organization: Bluewin AG X-Complaints-To: abuse@bluewin.ch To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/243 X-Sequence-Number: 10385 > > Hi, > > > > When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute > > "select * from myTable;" in an other db (e.g. myOtherDB). > > > > In other words, what is the postgreSQL equivalent of the MS SQL Server > > statement "USE myOtherDB SELECT * FROM myTable" ? > > Stock postgresql doesn't support cross database queries. > There is a contrib package which does. > > In the example you gave, you were combining information from two databases. > If it is the case that your application will be combining data from the > two databases, then you can open a separate connection to each database > and use the appropiate connection for your queries. Thank you for your answer. Do you know the name of this package ? Thx Lilian