Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2EB544DA6A8 for ; Thu, 10 May 2012 06:17:29 -0300 (ADT) Received: from auth-smtp.nebula.fi ([217.30.180.105]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SSPV0-0005gj-Bf for pgsql-jdbc@postgresql.org; Thu, 10 May 2012 09:17:29 +0000 Received: from quadvadis.localdomain (gw.nitor.fi [83.145.228.24]) (authenticated bits=0) by auth-smtp.nebula.fi (8.13.8/8.13.4) with ESMTP id q4A9HB06030904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 May 2012 12:17:11 +0300 Message-ID: <4FAB8796.40904@nitorcreations.com> Date: Thu, 10 May 2012 12:17:10 +0300 From: Mikko Tiihonen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Patch: Add support for hstore extension - and map it to/from java.util.Map Content-Type: multipart/mixed; boundary="------------010709050509060608030205" X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201205/24 X-Sequence-Number: 22924 This is a multi-part message in MIME format. --------------010709050509060608030205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Similarly a Statement.setObject(Map 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= 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 --------------010709050509060608030205 Content-Type: text/x-patch; name="Add-support-for-mapping-java.util.Map-hstore.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Add-support-for-mapping-java.util.Map-hstore.patch" --------------010709050509060608030205--