pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
To: pgsql-jdbc@postgresql.org
Subject: Patch: Add support for hstore extension - and map it to/from java.util.Map
Date: Thu, 10 May 2012 12:17:10 +0300
Message-ID: <4FAB8796.40904@nitorcreations.com> (raw)

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

Attachments:

  Add-support-for-mapping-java.util.Map-hstore.patch (text/x-patch, 0B) download

view thread (4+ messages)  latest in thread

Message-ID: <4FAB8796.40904@nitorcreations.com>
Permalink:  ../4FAB8796.40904@nitorcreations.com/
Also on:    postgresql.org/message-id/4FAB8796.40904@nitorcreations.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mikko.tiihonen@nitorcreations.com
  Subject: Re: Patch: Add support for hstore extension - and map it to/from java.util.Map
  In-Reply-To: <4FAB8796.40904@nitorcreations.com>
  References: <4FAB8796.40904@nitorcreations.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox