JDBC String to Bool spec - Mailing list pgsql-jdbc

From Kevin Wooten
Subject JDBC String to Bool spec
Date
Msg-id 990BE54A-5803-4B5A-A5C8-BD6DBE75B72C@me.com
Whole thread Raw
Responses Re: JDBC String to Bool spec
Re: JDBC String to Bool spec
List pgsql-jdbc
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/varcharcolumn with the value “1.0”.  This conversion succeeds because the driver (both pgjdbc & ng) fallback to
decodingthe 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
ofyet. 

pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: [JDBC] Re: Efficient use of ON CONFLICT DO UPDATE with the PostgreSQL JDBCdriver
Next
From: Dave Cramer
Date:
Subject: Re: [JDBC] JDBC String to Bool spec