From: Bruce Momjian Date: Thu, 6 Sep 2001 18:26:37 +0000 (+0000) Subject: On Mon, 3 Sep 2001 22:01:17 -0500, you wrote: X-Git-Tag: REL7_2_BETA1~520 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afa178e7e2118800d9723a0608eb1dc8a4beef6f;p=postgresql On Mon, 3 Sep 2001 22:01:17 -0500, you wrote: >public boolean isWritable(int column) throws SQLException >{ > if (isReadOnly(column)) > return true; > else > return false; >} The author probably intended: public boolean isWritable(int column) throws SQLException { return !isReadOnly(column); } And if he would have coded it this way he wouldn't have made this mistake :-) >hence, isWritable() will always return false. this is something >of a problem :) Why exactly? In a way, true is just as incorrect as false, and perhaps it should throw "not implemented". But I guess that would be too non-backwardly-compatible. >let me know if i can provide further information. Will you submit a patch? Regards, Ren? Pijlman --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java index d9e09c01dd..73575cbaca 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java @@ -419,10 +419,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData */ public boolean isWritable(int column) throws SQLException { - if (isReadOnly(column)) - return true; - else - return false; + return !isReadOnly(column); } /** diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java index 5d878b149e..d1db49c054 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java @@ -414,10 +414,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData */ public boolean isWritable(int column) throws SQLException { - if (isReadOnly(column)) - return true; - else - return false; + return !isReadOnly(column); } /**