From 0059c4216c1e106311cd935dee2b9c42d9a7a1d3 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Thu, 6 Sep 2001 20:43:39 +0000
Subject: [PATCH] >Well, if it is that easy, I can do it.  Patch attached and
 applied. > >> On Mon, 3 Sep 2001 22:01:17 -0500, you wrote: >>     public
 boolean isWritable(int column) throws SQLException >>     { >>         return
 !isReadOnly(column); >>     }

Actually, I think this change has a consequence for this method
in the same class:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return isWritable(column);
    }

This is from the JDBC spec
(http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html):

  isReadOnly() - Indicates whether the designated column is
definitely not writable.

  isWritable() - Indicates whether it is possible for a write on
the designated column to succeed.

  isDefinitelyWritable() - Indicates whether a write on the
designated column will definitely succeed.

At this time we don't really implement the fine semantics of
these methods. I would suggest the following defaults:

  isReadOnly()             false
  isWritable()             true
  isDefinitelyWritable()   false

And that would mean that your patch is correct, but
isDefinitelyWritable() would need to be patched accordingly:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return false;
    }

Again, both in jdbc1 and jdbc2.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
---
 src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java | 2 +-
 src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java
index 73575cbaca5..73b5b11367b 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java
@@ -434,7 +434,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
    */
   public boolean isDefinitelyWritable(int column) throws SQLException
   {
-    return isWritable(column);
+    return false;
   }
   
   // ********************************************************
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java
index d1db49c054b..e09b872f496 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java
@@ -429,7 +429,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
    */
   public boolean isDefinitelyWritable(int column) throws SQLException
   {
-    return isWritable(column);
+    return false;
   }
   
   // ********************************************************
-- 
GitLab