Index: AbstractJdbc2ResultSet.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v
retrieving revision 1.83
diff -u -r1.83 AbstractJdbc2ResultSet.java
--- AbstractJdbc2ResultSet.java 4 Dec 2005 21:40:33 -0000       1.83
+++ AbstractJdbc2ResultSet.java 3 Mar 2006 08:54:53 -0000
@@ -2434,22 +2434,28 @@

      //----------------- Formatting Methods -------------------

-    public static boolean toBoolean(String s)
+    public static boolean toBoolean(String s) throws PSQLException
      {
          if (s != null)
          {
              s = s.trim();

-            if (s.equalsIgnoreCase("true") || s.equalsIgnoreCase("t"))
-                return true;
-
+            if (s.equalsIgnoreCase("t") || s.equalsIgnoreCase("true")) { // examine the most frequent case first
+                return true;
+            } else if (s.equalsIgnoreCase("f") || s.equalsIgnoreCase("false")) { // explicite false check
+                return false;
+            }
+
              try
              {
                  if (Double.valueOf(s).doubleValue() == 1)
                      return true;
+                // TODO / FIXME: explicite false check
              }
              catch (NumberFormatException e)
              {
+                // throw exception if occurs
+                throw new PSQLException ("postgresql.res.baddouble", PSQLState.NUMERIC_VALUE_OUT_OF_RANGE, e);
              }
          }
          return false;  // SQL NULL
