Patch: Add support for hstore extension - and map it to/from java.util.Map

From: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Patch: Add support for hstore extension - and map it to/from java.util.Map
Date: 2012-05-10 09:17:10
Message-ID: 4FAB8796.40904@nitorcreations.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

Here is a patch to enable initial support for hstore in the jdbc driver.

With the patch using ResultSet.getObject() on a hstore column and it returns a HashMap<String, String>
Similarly a Statement.setObject(Map<Object,Object> will send the data to backend using hstore format.

The patch supports both text and binary transfer modes. However the current patch does not automatically enable the faster binary transfer more, but instead
user has to currently add binaryTransferEnable=<hstore-oid> to connection parameters.

I'm still pondering how to enable the binary transfers automatically without the overhead of fetching the hstore oid on each connection startup.
- can it be cached to some static cache based on connection url+login information?
- if not then a way to lazy evaluate it needs to be implemented

-Mikko

Attachment Content-Type Size
Add-support-for-mapping-java.util.Map-hstore.patch text/x-patch 0 bytes

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message mephysto 2012-05-11 13:08:11 Re: Fwd: Postgres JDBC, WS and commit
Previous Message Radosław Smogura 2012-05-10 05:57:59 Re: Fwd: Postgres JDBC, WS and commit