X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4BA319FA357 for ; Mon, 3 Jul 2006 12:19:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 12732-02 for ; Mon, 3 Jul 2006 12:19:37 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id 4C0D69FA232 for ; Mon, 3 Jul 2006 12:19:37 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so1569542ugf for ; Mon, 03 Jul 2006 08:19:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=E5JoOTsV2LWYN40zsWcO2NFK09XNaJvAqOc57J2kHqGZ1wDeVdbSEfb89kLY6vqD17T2cp7YMHMNloR1PZKy716Xrc3rLKepbBgA0O3nFngErVhOZuJLNnvu35lbBVYEJugMWE8DaSzmV82aA3tGUdF4E8unfWV9vCIeunfv9ic= Received: by 10.66.224.19 with SMTP id w19mr4192853ugg; Mon, 03 Jul 2006 08:19:35 -0700 (PDT) Received: by 10.66.239.19 with HTTP; Mon, 3 Jul 2006 08:19:35 -0700 (PDT) Message-ID: <6ff7932d0607030819o4775c43fr2762dd390d4cd76@mail.gmail.com> Date: Mon, 3 Jul 2006 17:19:35 +0200 From: "Yann PICHOT" To: pgsql-jdbc@postgresql.org Subject: Diffrence between 8.0.3 and 8.1.3 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_826_710291.1151939975669" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/7 X-Sequence-Number: 15433 ------=_Part_826_710291.1151939975669 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I use this JDBC Driver : JDBC driver build number : 8.1.407-JDBC3 Server version : test do on 8.0.3 (linux), 8.1.3 (linux) and 8.1.2 (windows) I have problem with the method getColumnDisplaySize in ResultSetMetaData class. I have this java program: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class Test { public static void main(String[] args) { try { Properties props = new Properties(); Statement stmt = null; Class.forName("org.postgresql.Driver"); props.put("user","xxxxx"); props.put("password","xxxxx"); Connection conn = DriverManager.getConnection("jdbc:postgresql://myhost/mydatabase", props); try { String SQLselect = "SELECT col1, cast(' ' as varchar(3)) as mycol FROM mytable"; stmt = conn.createStatement(); ResultSet res = stmt.executeQuery(SQLselect); ResultSetMetaData resMD = res.getMetaData(); System.out.println(resMD.getColumnDisplaySize(2)); res.close(); stmt.close(); } catch ( Exception e ) { System.out.println("Error 1 : " + e.getMessage()); e.printStackTrace(); } finally { conn.close(); } } catch ( Exception e) { System.out.println("Error 2 : " + e.getMessage()); e.printStackTrace(); } } } When i connect to 8.0.3 database the methode getColumnDisplaySize return 3, a good value When i connect to 8.1.2 or 8.1.3 database the methode getColumnDisplaySize return -5, a bad value. I saw the source of the JDBC Driver and i saw the difference is in data read on socket in the method receiveFields in QueryExecutorImpl class. When i connect to 8.0.3 database, on this line of the method : ... int typeModifier = pgStream.ReceiveIntegerR(4); ... typeModifier is set to 7. When i conenct to 8.1.2 or 8.1.3, typeModifier is set to -1 Is it normal ? Someone can explain this ? Regards, -- Yann ------=_Part_826_710291.1151939975669 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,

I use this JDBC Driver :
JDBC driver build number : 8.1.407-JDBC3
Server version : test do on 8.0.3 (linux), 8.1.3 (linux) and 8.1.2 (windows)

I have problem with the method getColumnDisplaySize in ResultSetMetaData class.

I have this java program:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement ;
import java.util.Properties;

public class Test {
  public static void main(String[] args) {
    try {
      Properties props = new Properties();
      Statement stmt = null;

      Class.forName ("org.postgresql.Driver");
      props.put("user","xxxxx");
      props.put("password","xxxxx");
      Connection conn = DriverManager.getConnection("jdbc:postgresql://myhost/mydatabase", props);


      try {
        String SQLselect = "SELECT col1, cast(' ' as varchar(3)) as mycol FROM mytable";
        stmt = conn.createStatement();
        ResultSet res = stmt.executeQuery(SQLselect);
        ResultSetMetaData resMD = res.getMetaData();
        System.out.println(resMD.getColumnDisplaySize(2));
        res.close();
        stmt.close();
      } catch ( Exception e ) {
        System.out.println ("Error 1 : " + e.getMessage());
        e.printStackTrace();
      }
      finally {
        conn.close();
      }
    } catch ( Exception e) {
      System.out.println("Error 2 : " + e.getMessage());
      e.printStackTrace();
    }
  }
}

When i connect to 8.0.3 database the methode getColumnDisplaySize return 3, a good value
When i connect to 8.1.2 or 8.1.3 database the methode getColumnDisplaySize return -5, a bad value.

I saw the source of the JDBC Driver and i saw the difference is in data read on socket in the method receiveFields in QueryExecutorImpl class.
When i connect to 8.0.3 database, on this line of the method :
  ...
  int typeModifier = pgStream.ReceiveIntegerR(4);
  ...
typeModifier is set to 7.

When i conenct to 8.1.2 or 8.1.3, typeModifier is set to -1

Is it normal ?  Someone can explain this ?

Regards,

--
Yann ------=_Part_826_710291.1151939975669--