Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 9BDEC189E838; Tue, 10 Apr 2012 10:42:37 -0300 (ADT) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SHbL9-0007sH-2p; Tue, 10 Apr 2012 13:42:37 +0000 X-Originating-IP: 217.70.178.148 Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 0D8C4A80BB; Tue, 10 Apr 2012 15:42:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter20-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id DSoxt+7kCgro; Tue, 10 Apr 2012 15:42:09 +0200 (CEST) X-Originating-IP: 98.27.54.176 Received: from [192.168.10.146] (cpe-098-027-054-176.nc.res.rr.com [98.27.54.176]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 4D7A1A80C5; Tue, 10 Apr 2012 15:42:08 +0200 (CEST) Message-ID: <4F8438AD.7060503@dunslane.net> Date: Tue, 10 Apr 2012 09:42:05 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Atri Sharma CC: Dave Cramer , Merlin Moncure , Pg Hackers , pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Regarding GSoc Application References: <4f802005.cc76440a.668b.ffffcd8e@mx.google.com> <4F831234.7040209@dunslane.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/452 X-Sequence-Number: 206255 On 04/09/2012 01:25 PM, Atri Sharma wrote: > On Mon, Apr 9, 2012 at 10:15 PM, Andrew Dunstan wrote: >> >> On 04/09/2012 12:14 PM, Dave Cramer wrote: >>> >>> So I'm confused, once they link a file to an FDW can't you just read >>> it with an normal select ? >>> >>> What additional functionality will this provide ? >>> >> >> >> I'm confused about what you're confused about. Surely this won't be linking >> files to an FDW, but foreign DBMS tables, in anything you can access via >> JDBC. All you'll need on the postgres side is the relevant JDBC driver, so >> you'd have instant access via standard select queries to anything you can >> get a JDBC driver to talk to. That seems to me something worth having. >> >> I imagine it would look rather like this: >> >> CREATE FOREIGN DATA WRAPPER foodb HANDLER pljava_jdbc_handler >> OPTIONS (driver 'jdbc.foodb.org'); >> CREATE SERVER myfoodb FOREIGN DATA WRAPPER foodb OPTIONS(host >> '1.2.3.4', user 'foouser', password 'foopw'); >> CREATE FOREIGN TABLE footbl (id int, data text) SERVER myfoodb; >> SELECT * from footbl; >> >> >> cheers >> >> andrew > Hi Andrew, > > Thanks for going through my proposal and commenting on it. > > I think you have hit the nail on the head.We will be connecting the > foreign DBMS tables.The main aim of the project is to wrap JDBC so we > can connect to anything that can be reached through a JDBC URL. > > I am considering two paths for doing this: > The first one takes the help of the SPI(Server Programming Interface) > and the second one directly connects through Pl/Java and JNI(Java > Native Interface). > I'd say forget SPI - I don't think it's going to help you here. Just concentrate on getting the functionality via a PL/Java wrapper. I wouldn't worry too much about jdbc style URLs either, since logically I think you'd want to specify the connection parameters via server and FDW options as in my example above - that way it would be consistent with other FDWs. But that's a piece of bikeshedding for now. Basically, you want to implement the handler function to start with. cheers andrew