Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCZau-0006GV-J2 for pgsql-jdbc@arkaria.postgresql.org; Tue, 07 Jul 2015 20:35:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCZat-0005if-Mc for pgsql-jdbc@arkaria.postgresql.org; Tue, 07 Jul 2015 20:35:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCZZn-0004Lx-Bs for pgsql-jdbc@postgresql.org; Tue, 07 Jul 2015 20:34:47 +0000 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZCZZk-0003BQ-FZ for pgsql-jdbc@postgresql.org; Tue, 07 Jul 2015 20:34:45 +0000 Received: by widjy10 with SMTP id jy10so199251565wid.1 for ; Tue, 07 Jul 2015 13:34:42 -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=Itz/Exb6WxtqT4s4fcuu0ziX3fuMKlV/HYhyIE/5Wu8=; b=B+tws93HD0V6bwX7HKuZJETrR4HVIJwy/srpk/uUjBp0xAtl7DpOa+LA47rDB2kcPj N4k6yUFMsDCS/ofwdiI7Wd/nIzq4ybYiKgjGyQ4ilFSZ7gcQkhVn+FU1dGQzVr0gi4zy vhpHJK1K/ryot8dzpNbo8/82KrBxvgl6HKwduhXXGNuTVdxw6ORxj1JAW8BZ8ZuB6Ogy XeAe+GhviKWQMBuFHxCCKBoa4dUUFxy+MFwvlJ0Xk4TifeI+xZSWC2yS0cB7heG46eYq umkCobYWBh2uEcOQwt2pcywd8h2j4LJ3ksjHYXJnrgU/mZ6tVURXTtWkGBqOgW9GQR/Y OCrw== X-Received: by 10.194.86.161 with SMTP id q1mr12449190wjz.18.1436301282939; Tue, 07 Jul 2015 13:34:42 -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 q4sm35147704wja.24.2015.07.07.13.34.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 13:34:42 -0700 (PDT) Message-ID: <559C37E0.6070809@iki.fi> Date: Tue, 07 Jul 2015 23:34:40 +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: Dave Cramer CC: Kevin Wooten , 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> <559C358B.1000601@iki.fi> In-Reply-To: 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:26 PM, Dave Cramer wrote: > On 7 July 2015 at 16:24, Heikki Linnakangas wrote: > >> 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? >> > I think Kevin was hoping the server would just "figure it out" without all > the back and forth. Well, if you use the binary representation, you need to somehow tell the server which datatype's binary representation you're using. Perhaps you could tell the server "I'm sending this in the binary representation of int4, but I still want you to deduce the actual type as if it was unknown", but that raises the question: if you know it's an integer, why do you want the server to do the deduction? - Heikki -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc