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 BA46ADA459 for ; Thu, 6 Oct 2005 21:59:55 -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 45067-04 for ; Fri, 7 Oct 2005 00:59:49 +0000 (GMT) Received: from challengelogistics.com.au (unknown [203.48.241.83]) by svr1.postgresql.org (Postfix) with ESMTP id DF4F1D97FB for ; Thu, 6 Oct 2005 21:59:48 -0300 (ADT) Received: from isis.challengelogistics.com.au ([192.168.160.31]) by sameagle with InterScan Messaging Security Suite; Fri, 07 Oct 2005 10:59:53 +1000 Received: from sandy01.challengelogistics.com.au ([192.168.160.3]) by isis.challengelogistics.com.au with Microsoft SMTPSVC(6.0.3790.1830); Fri, 7 Oct 2005 11:01:27 +1000 From: "Bath, David" Reply-To: dave.bath@unix.net To: pgsql-sql@postgresql.org Subject: RULES on SELECT with JDBC/perlDBI from other RDBMS products? Date: Fri, 7 Oct 2005 11:07:37 +1000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510071107.38564.dave.bath@unix.net> X-OriginalArrivalTime: 07 Oct 2005 01:01:27.0781 (UTC) FILETIME=[A5797950:01C5CADA] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.086 required=5 tests=[AWL=0.086] X-Spam-Level: X-Archive-Number: 200510/68 X-Sequence-Number: 22921 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? -- David T. Bath dave.bath@unix.net