X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CF5FBDA538 for ; Fri, 7 Oct 2005 07:24:01 -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 45502-03 for ; Fri, 7 Oct 2005 10:23:52 +0000 (GMT) Received: from wimpy.net.nih.gov (wimpy.net.nih.gov [128.231.88.106]) by svr1.postgresql.org (Postfix) with ESMTP id A6B1BD9AB9 for ; Fri, 7 Oct 2005 07:23:52 -0300 (ADT) Received: from wimpy.net.nih.gov (localhost [127.0.0.1]) by wimpy.net.nih.gov (8.12.11/8.11.7) with ESMTP id j97ANs9L021471 for ; Fri, 7 Oct 2005 06:23:54 -0400 (EDT) Received: from [128.231.145.14] (holmes.nhgri.nih.gov [128.231.145.14]) by wimpy.net.nih.gov (8.12.11/8.11.7) with ESMTP id j97ANrHk021467; Fri, 7 Oct 2005 06:23:53 -0400 (EDT) User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Fri, 07 Oct 2005 06:23:53 -0400 Subject: Re: RULES on SELECT with JDBC/perlDBI from other RDBMS From: Sean Davis To: , Message-ID: In-Reply-To: <200510071107.38564.dave.bath@unix.net> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.014 required=5 tests=[AWL=0.014] X-Spam-Level: X-Archive-Number: 200510/72 X-Sequence-Number: 22925 On 10/6/05 9:07 PM, "Bath, David" wrote: > Folks, > > I'm looking at using pg to be the main platform for integrating info > from other RDBMS products (particularly Oracle) as pg seems to be > the most flexible RDBMS around. > > Disregarding writing to foreign products, query-plan efficiencies, > or differences of SQL dialect, I'd like to have a way of setting > up a fairly-transparent SELECT within pg that pulls rows from the > other product. I wonder if anyone has attempted something like > this, and can recommend (or even deprecate) an approach, and perhaps > point to a code template. > > Possible approaches that occur to me include > 1. For the low-level integration .... > a) Use of "foreign" JDBC thin client within PL/Java > b) Use of untrusted perl DBI/DBD > c) Use of low-level C code (e.g. declaring Oracle OCI calls > to pg) - very labor intensive > 2. For "transparent" use by other routines.... > Create pg table/view, then write rules that use functions > returning rows (including barf exceptions if someone tries > writing to a table). > > If I can embed a java thin client binary/jar for the foreign > database in pg and use it using pg pl/java, then I'd like to > go that path as it would decrease setup/admin effort when > porting to other platforms, as there would be few dependencies > on things like external perl modules. > > If any pg developer gurus are reading this, perhaps such templates > might be worthwhile including in the contrib bundle? > The DBI-link project is quite useful for doing just what you describe, if I understand you correctly. http://pgfoundry.org/projects/dbi-link/ http://www.pervasivepostgres.com/postgresql/tidbits_June05.asp Sean