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>
Cc: 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 23:24:43 +0300
Message-ID: <559C358B.1000601@iki.fi> (raw)
In-Reply-To: <652E425F-7564-43E5-A3E7-86EE00E6157A@me.com>
References: <CADK3HHLfJEx5i0CgvP=dGBXHUiHAcvTu0QeDoQTkyne42xn3fA@mail.gmail.com>
	<80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com>
	<559C2CA8.6000200@iki.fi>
	<652E425F-7564-43E5-A3E7-86EE00E6157A@me.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 07/07/2015 11:04 PM, Kevin Wooten wrote:
> As far as “coercion" goes maybe a better term would be “deduction”.
> There are numerous cases where it would be great if we could send the
> server a “don’t care” type and just a binary format.   Instead we
> have to specify a type and format together. Doing this causes issues
> in edge cases (e.g. strings coming back padded because we specified
> varchar but the column was text).

Oh, are you talking about query parameters, sent from the client to the 
server? The type OID and format code are not actually sent in the same 
message - you give the OID in the Parse message and the format code in 
Bind. You don't have to specify the OID in the Parse if you don't want 
to, and the server will deduce the most sensible one from the query 
context. After the Parse, you can find out what the server deduced by 
sending a ParameterDescription message, and then form the appropriate 
binary representation for the deduced type, and send it with Bind. Am I 
missing something?

- 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: <559C358B.1000601@iki.fi>
Permalink:  ../559C358B.1000601@iki.fi/
Also on:    postgresql.org/message-id/559C358B.1000601@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: <559C358B.1000601@iki.fi>
  References: <CADK3HHLfJEx5i0CgvP=dGBXHUiHAcvTu0QeDoQTkyne42xn3fA@mail.gmail.com> <80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com> <559C2CA8.6000200@iki.fi> <652E425F-7564-43E5-A3E7-86EE00E6157A@me.com> <559C358B.1000601@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