Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCZQz-0005mR-45 for pgsql-jdbc@arkaria.postgresql.org; Tue, 07 Jul 2015 20:25:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCZQy-0008US-8t for pgsql-jdbc@arkaria.postgresql.org; Tue, 07 Jul 2015 20:25:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCZQ9-0007Rt-SS for pgsql-jdbc@postgresql.org; Tue, 07 Jul 2015 20:24:50 +0000 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZCZQ6-0002Fu-SR for pgsql-jdbc@postgresql.org; Tue, 07 Jul 2015 20:24:49 +0000 Received: by wiclp1 with SMTP id lp1so61728610wic.0 for ; Tue, 07 Jul 2015 13:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=4qQklXPUyipGur9Th6cdqJYurbsdkw7ot64X+GbEnoE=; b=U8wLRFIk/Mbjr1sOzwL8SGYurPemXZ+GfEm3/WqP5cuYXmNRH7k5w8TtBdadsWL/VA +ZMY/H0JXLyodoJXdpyunUCofc//Br5ZZh/Me9F3Zz0bQ36EK1zBuZgreGuZEF4mtP2s 19b8SYOAng0szjjVXbf+3iK7m9VO9K/uLkG+SZ9/DeWNCBPAqrAjFzLKV3yCB002cL0N S+NBeK2mGruMnKDwpU9+f0yK/1reMdMTmn39CkGE2WZsGSxLMhAVb2E6uJohju4iAMcb QwxWBBHWRxKt5KykQwUB/s9Hs9W102+fO5HntGpWlhgvKr5zgAD+onsI3zZaQdxgCHL3 6fzg== X-Received: by 10.194.192.72 with SMTP id he8mr12119087wjc.11.1436300686268; Tue, 07 Jul 2015 13:24:46 -0700 (PDT) Received: from [192.168.1.110] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id wx9sm35103501wjb.6.2015.07.07.13.24.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 13:24:45 -0700 (PDT) Message-ID: <559C358B.1000601@iki.fi> Date: Tue, 07 Jul 2015 23:24:43 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Kevin Wooten CC: Dave Cramer , List Subject: Re: PostgreSQL gaps wrt to java, and jdbc References: <80FEC5E5-DD36-46F4-A510-31E08415FBB1@me.com> <559C2CA8.6000200@iki.fi> <652E425F-7564-43E5-A3E7-86EE00E6157A@me.com> In-Reply-To: <652E425F-7564-43E5-A3E7-86EE00E6157A@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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