Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTEdu-0000EC-MM for pgsql-jdbc@arkaria.postgresql.org; Mon, 16 Jan 2017 21:16:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTEdt-0003Fv-Rv for pgsql-jdbc@arkaria.postgresql.org; Mon, 16 Jan 2017 21:16:41 +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_2) (envelope-from ) id 1cTEdP-0002MR-DD for pgsql-jdbc@postgresql.org; Mon, 16 Jan 2017 21:16:11 +0000 Received: from mail-ua0-x242.google.com ([2607:f8b0:400c:c08::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cTEdL-00075w-Bz for pgsql-jdbc@postgresql.org; Mon, 16 Jan 2017 21:16:09 +0000 Received: by mail-ua0-x242.google.com with SMTP id f2so10767751uaf.3 for ; Mon, 16 Jan 2017 13:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=eg69dwCpfROS+DbG2aER9O56+TJZiEV4ovcFRHdHn44=; b=abwRK44Dhqbtwwd5pkaTwkIzNyqExbFH7nu6tWBl7GFmYR0XYmWEHKKtdwbZtOzJNC +xTrBizwP/qoQAkl9fh79hX7nbnV9MpCF+aOmvfF1B64cSPHUHAypQA3VAj2Ss4nmQGn svco119ttcK+sj7w9B60GOIItst0bRfXkDMn4zWthCB5nIFSm9+e+45kHlWtR3mxEbY3 /EEiPTjTTX1Cf0zpN+n+QMewL8dzDOIAxs4IIJyW6rentmOqQWBklNNh8DDxilOPNoHD C6dkcs8RKH/kGbdcIPVY8Fr/C5Xxk966U0t/gJBOPRyNm+IphrtB51iFdlqIfq3wjPdF ilLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=eg69dwCpfROS+DbG2aER9O56+TJZiEV4ovcFRHdHn44=; b=Aae7nTQfODPL/uqpNvbFpvEViIbauvWq1JqvcbDmvNbNpiCxeouNST2xYCSMigswok LT7HYbN8ODx1MutHF/91bga4qR9pCJoEZCU6O1Td5r7sktQkzpkiSNAoHfWU18FDR8aq EYlYA4Ar2mMUgc6IOyVqrua+poHKK/1/BMiHmvs1WgdKcO3likS5335UVt8XiNp7WqSK 0/UwnyJtmKVPl2rWEOIyk78TscHo+QgTxu+0/Hd6YIP1K3sv07Q/NWWAPoisGFAT7V+G arvTQ6gzKMo41tUI3FB+ECj7sp+hopwEoR7bVSvC0PI1go+vtbSU55rPAc2VUA09ONPj gRuA== X-Gm-Message-State: AIkVDXIu98xnhXo7E7+fLFZm0YXQM13pLgnLYXyV04OaHMo4egXXVLMCjjD8TalBg+QQjQ== X-Received: by 10.159.36.72 with SMTP id 66mr18182085uaq.173.1484601366275; Mon, 16 Jan 2017 13:16:06 -0800 (PST) Received: from roblaptop ([2804:14d:baa0:8560:461e:a1ff:fe19:c7bd]) by smtp.gmail.com with ESMTPSA id l94sm8964438ual.9.2017.01.16.13.16.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jan 2017 13:16:05 -0800 (PST) Message-ID: <1484601362.6580.1.camel@gmail.com> Subject: Re: JDBC String to Bool spec From: rob stone To: Jorge =?ISO-8859-1?Q?Sol=F3rzano?= , Kevin Wooten Cc: Dave Cramer , "pgsql-jdbc@postgresql.org" Date: Tue, 17 Jan 2017 08:16:02 +1100 In-Reply-To: References: <990BE54A-5803-4B5A-A5C8-BD6DBE75B72C@me.com> <67BD0617-E3A5-43BD-9770-6C2611187092@me.com> <83AB5852-8884-465E-80D8-A49B6CB05A88@me.com> <0AA59CB8-5010-4E1A-A631-DF7819F40EE5@me.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.0 (--) 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 Hello, > > > > Since we now know the JDBC spec doesn’t support this (thanks to all > > of Mark Rotteveel’s sleuthing) & we know Postgres doesn’t support > > this.  It seems the “feature" should be removed or placed behind an > > option.  Postgres results in an error here and considering this is > > a driver tied to that database I look to that to clarify ambiguity. > > These examples should all result in an error. > > > > > > > > Yes, I agree, a "feature" that allows bad code should be considered > a "bug". > > The OP in the original post used a string of "1.0" and wanted to convert it into a boolean. If you use setBoolean in a prepared statement it expects the argument to be a "numeric" type, so it is not surprising that the string was converted to a double. You'd expect something along the lines of ps.setBoolean(5,"xyz") to throw an error. I don't know how many string values are to be considered "true" in the application. Maybe use some regular expressions to suss out "true" values? My two cents. Rob -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc