Re: JDBC String to Bool spec - Mailing list pgsql-jdbc

From Kevin Wooten
Subject Re: JDBC String to Bool spec
Date
Msg-id 67BD0617-E3A5-43BD-9770-6C2611187092@me.com
Whole thread Raw
In response to Re: [JDBC] JDBC String to Bool spec  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: JDBC String to Bool spec
List pgsql-jdbc
Thanks… is there a reason those tables were dropped from the 4.2 spec PDF?

On Jan 15, 2017, at 4:26 PM, Dave Cramer <pg@fastcrypt.com> wrote:



On 15 January 2017 at 18:20, Kevin Wooten <kdubb@me.com> wrote:
Does anybody know where in the specification it details the required/acceptable conversions from string values to boolean?  I cannot seem to find it in the PDF for 4.2.

I am curious about some of the conversions that are done.  For example, calling “ResultSet.getBoolean” on a text/varchar column with the value “1.0”.  This conversion succeeds because the driver (both pgjdbc & ng) fallback to decoding the column as a double then converting that by testing it “== 1”; which seems valid but questionable since “!= 0” would also be valid, but vastly different.

This is not allowed by Postgres (e.g. “SELECT “1.0”::bool;” results in an error) and I cannot find anything in JDBC as of yet.

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


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: [JDBC] JDBC String to Bool spec
Next
From: Kevin Wooten
Date:
Subject: Re: [JDBC] JDBC String to Bool spec