Re: [JDBC] Regarding GSoc Application

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Regarding GSoc Application
Date: 2012-04-10 13:42:05
Message-ID: 4F8438AD.7060503@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On 04/09/2012 01:25 PM, Atri Sharma wrote:
> On Mon, Apr 9, 2012 at 10:15 PM, Andrew Dunstan<andrew(at)dunslane(dot)net> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-04-10 13:46:45 Re: Deprecating non-select rules (was Re: Last gasp)
Previous Message Robert Haas 2012-04-10 13:40:58 disposition of remaining patches

Browse pgsql-jdbc by date

  From Date Subject
Next Message Merlin Moncure 2012-04-10 13:48:43 Re: [JDBC] Regarding GSoc Application
Previous Message Atri Sharma 2012-04-10 13:29:51 Re: Regarding GSoc proposal