X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 38EDED1C98D for ; Fri, 1 Aug 2003 00:38:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 97897-08 for ; Thu, 31 Jul 2003 21:37:41 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 758B4D1C976 for ; Thu, 31 Jul 2003 21:38:45 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id D46281024D; Thu, 31 Jul 2003 20:31:31 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-81.tor.dsl.tht.net [134.22.133.81]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 87E7510248; Thu, 31 Jul 2003 20:31:29 -0400 (EDT) Subject: Re: select query that would join two databases From: Rod Taylor To: "Keith H.K. Lam (U1 Tech.)" Cc: "'pgsql-sql@postgresql.org'" In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-/PbQdPBKLlwEjCSVreOK" Message-Id: <1059698371.33557.11.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 31 Jul 2003 20:39:32 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/501 X-Sequence-Number: 14615 --=-/PbQdPBKLlwEjCSVreOK Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Take a look at the dblink() contrib module. PostgreSQL does not currently support inter-database joins BUT it does offer Schemas which is often enough. Take each of your source databases and toss them into two different schemas of the same database. On Wed, 2003-07-30 at 07:28, Keith H.K. Lam (U1 Tech.) wrote: > dear all, >=20 > How to create a query that would join two databases? In MSSQL, i use >=20 > select * from dbA.dbo.tableA a dbB.dbo.tableB b where a.id=3Db.id >=20 > Is there anyway to write the above query in postgressql ? >=20 > Please email me back. > Thanks, > Keith >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >=20 --=-/PbQdPBKLlwEjCSVreOK Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/KbbD6DETLow6vwwRAqr6AJ9t6rY0vuORmAun8JmGeQLI3DP9DACbB36C C9M66wnY3Z3U9E8h3mWOsY4= =WXNv -----END PGP SIGNATURE----- --=-/PbQdPBKLlwEjCSVreOK--