From 2000info@netsite.com.br Thu Oct 10 12:28:43 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DF5E147655A for ; Thu, 10 Oct 2002 08:28:43 -0400 (EDT) Received: from smtp.netsite.com.br (unknown [200.187.175.85]) by postgresql.org (Postfix) with ESMTP id 5BEBD476482 for ; Thu, 10 Oct 2002 08:28:42 -0400 (EDT) Received: from server2000 (netsite-fac-f1-022.idial.com.br [200.225.231.22]) by smtp.netsite.com.br (Postfix) with SMTP id 01F5B20414A; Thu, 10 Oct 2002 09:28:05 -0300 (BRT) Message-ID: <005101c27059$d970be00$0100a8c0@Info2000.com.br> From: =?iso-8859-1?Q?2000_Inform=E1tica?= <2000info@netsite.com.br> To: "pgsql Ludwig Lim" , "pgsql Laurette Cisneros" , "pgsql Christoph Haller" , "pgsql Achilleus Mantzios" , "PG SQL Mailim" Subject: SELECT with INNER data bases Date: Thu, 10 Oct 2002 09:37:49 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004E_01C27040.B2C29670" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/133 X-Sequence-Number: 9850 This is a multi-part message in MIME format. ------=_NextPart_000_004E_01C27040.B2C29670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have two data bases: db1 and db2. In MS SQL Server I can use=20 'SELECT T1.ID, T2.NAME FROM db1..table1 T1 INNER JOIN db2..table2 T2 ON T1.ID =3D T2.ID ...'. How I do it in the PosgreSQL ? HELP ME, PLEASE ! Sorry,=20 I'm a Brazilian and I don't speak and write English very well ! Silvio 2000Info ------=_NextPart_000_004E_01C27040.B2C29670 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have two data bases: db1 and db2.=
In MS SQL Server I can use
'SELECT T1.ID, T2.NAME FROM db1..table1 T1= INNER=20 JOIN db2..table2 T2
ON T1.ID =3D T2.ID ...'.
 
How I do it in the PosgreSQL ?
 
HELP ME, PLEASE !
 
Sorry,
I'm a Brazilian and I don't speak and writ= e English=20 very well !
 
Silvio
2000Info
 
------=_NextPart_000_004E_01C27040.B2C29670-- From bruno@wolff.to Thu Oct 10 12:33:16 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A65134765A6 for ; Thu, 10 Oct 2002 08:33:16 -0400 (EDT) Received: from wolff.to (unknown [66.93.197.35]) by postgresql.org (Postfix) with SMTP id E3BB447659D for ; Thu, 10 Oct 2002 08:33:15 -0400 (EDT) Received: (qmail 23915 invoked by uid 500); 10 Oct 2002 12:41:50 -0000 Date: Thu, 10 Oct 2002 07:41:50 -0500 From: Bruno Wolff III To: 2000 =?iso-8859-1?Q?Inform=E1tica?= <2000info@netsite.com.br> Cc: pgsql Ludwig Lim , pgsql Laurette Cisneros , pgsql Christoph Haller , pgsql Achilleus Mantzios , PG SQL Mailim Subject: Re: SELECT with INNER data bases Message-ID: <20021010124150.GA23840@wolff.to> Mail-Followup-To: 2000 =?iso-8859-1?Q?Inform=E1tica?= <2000info@netsite.com.br>, pgsql Ludwig Lim , pgsql Laurette Cisneros , pgsql Christoph Haller , pgsql Achilleus Mantzios , PG SQL Mailim References: <005101c27059$d970be00$0100a8c0@Info2000.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <005101c27059$d970be00$0100a8c0@Info2000.com.br> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/134 X-Sequence-Number: 9851 On Thu, Oct 10, 2002 at 09:37:49 -0300, 2000 Informática <2000info@netsite.com.br> wrote: > Hi, > > I have two data bases: db1 and db2. > In MS SQL Server I can use > 'SELECT T1.ID, T2.NAME FROM db1..table1 T1 INNER JOIN db2..table2 T2 > ON T1.ID = T2.ID ...'. > > How I do it in the PosgreSQL ? Postgres does not allow for queries to reference more than one database. In 7.3 (currently in beta), you may be able to use schemas to keep your data in the same database and use queries referencing tables in different schemas. Whether or not this will work for you depends on why you have put the data into different databases. From rmello@cc.usu.edu Thu Oct 10 15:12:43 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 99ADD47610B for ; Thu, 10 Oct 2002 11:12:43 -0400 (EDT) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id 206A247612E for ; Thu, 10 Oct 2002 11:12:39 -0400 (EDT) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 17zf6V-0006Wk-00; Thu, 10 Oct 2002 09:19:59 -0600 Date: Thu, 10 Oct 2002 09:19:59 -0600 From: Roberto Mello To: 2000 =?iso-8859-1?Q?Inform=E1tica?= <2000info@netsite.com.br> Cc: pgsql Ludwig Lim , pgsql Laurette Cisneros , pgsql Christoph Haller , pgsql Achilleus Mantzios , PG SQL Mailim Subject: Re: SELECT with INNER data bases Message-ID: <20021010151959.GE24541@cc.usu.edu> References: <005101c27059$d970be00$0100a8c0@Info2000.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <005101c27059$d970be00$0100a8c0@Info2000.com.br> User-Agent: Mutt/1.4i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/135 X-Sequence-Number: 9852 On Thu, Oct 10, 2002 at 09:37:49AM -0300, 2000 Informática wrote: > Hi, > > I have two data bases: db1 and db2. > In MS SQL Server I can use > 'SELECT T1.ID, T2.NAME FROM db1..table1 T1 INNER JOIN db2..table2 T2 > ON T1.ID = T2.ID ...'. > > How I do it in the PosgreSQL ? > > HELP ME, PLEASE ! > > Sorry, > I'm a Brazilian and I don't speak and write English very well ! PostgreSQL doesn't allow this by default. You can use 7.3 and schemas as as suggested, or use a loadable module called dblink with 7.2. dblink is under the PostgreSQL contrib/ directory. See its documentation. And here goes the same as above, but in Portuguese :) O PostgreSQL não permite isso por padrão. Você pode usar 7.3 e schemas como foi sugerido, ou usar um módulo chamado dblink com 7.2. Esse módulo está no diretório contrib do PostgreSQL. Veja sua documentação. -Roberto -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + But what can you do with it? -- ubiquitous cry from Linux-user partner