pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Kevin Wooten <kdubb@me.com>
To: Dave Cramer <davecramer@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: PostgreSQL gaps wrt to java, and jdbc
Date: Tue, 07 Jul 2015 22:46:48 +0300
Message-ID: <559C2CA8.6000200@iki.fi> (raw)
In-Reply-To: <80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com>
References: <CADK3HHLfJEx5i0CgvP=dGBXHUiHAcvTu0QeDoQTkyne42xn3fA@mail.gmail.com>
	<80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 07/07/2015 09:31 PM, Kevin Wooten wrote:
> == Binary type coercion ==
> The biggest impediment I’ve run into is the fact that PG will not
> attempt coercion on binary types. If you specify a binary type in the
> protocol, that’s the final word. A better system would be to have PG
> perform the same coercion it does for text types and then send the
> results back with coerced types, in binary; finally falling back to
> text when binary cannot be produced. This would solve almost every
> issue we have had to work around in the “ng” driver.

Can you elaborate? I'm confused, because the server can produce binary 
output for any datatype that has binary output functions. That covers 
all built-in datatypes and all extension datatypes people use in practice.

What I've imagined to be a problem, though, is that you have to either 
understand the binary representation of all datatypes in the client, or 
you have to request binary for only those datatypes you can handle. And 
to know which datatype a result set's column has, you have to Describe 
it before fetching the results, which adds an extra round-trip. So it 
would be handy if the driver could provide the server a list of 
datatypes that should be sent as binary, as a one-time operation at the 
beginning of the session for example, rather than indicating for each 
column in each query separately.

- Heikki



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (21+ messages)  latest in thread

Message-ID: <559C2CA8.6000200@iki.fi>
Permalink:  ../559C2CA8.6000200@iki.fi/
Also on:    postgresql.org/message-id/559C2CA8.6000200@iki.fi

 · 

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: hlinnaka@iki.fi, kdubb@me.com, davecramer@gmail.com
  Subject: Re: PostgreSQL gaps wrt to java, and jdbc
  In-Reply-To: <559C2CA8.6000200@iki.fi>
  References: <CADK3HHLfJEx5i0CgvP=dGBXHUiHAcvTu0QeDoQTkyne42xn3fA@mail.gmail.com> <80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com> <559C2CA8.6000200@iki.fi>

* 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