From: | "Gilles Dubochet" <dubochet(at)urbanet(dot)ch> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #1712: JDBC column precision for bigint is 0 |
Date: | 2005-06-10 13:28:29 |
Message-ID: | 20050610132829.96D60F0AC8@svr2.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 1712
Logged by: Gilles Dubochet
Email address: dubochet(at)urbanet(dot)ch
PostgreSQL version: 8.0.2
Operating system: Linux
Description: JDBC column precision for bigint is 0
Details:
Whith the JDBC driver at least up to version 8.1dev-400, the result of the
getPrecision method of ResultSetMetaData on a bigint column is 0 instead of
the expected 19.
Code seems to be missing in
org.postgresql.jdbc2.AbstractJdbc2ResultSetMetadata after line 359 (in
source code 8.1dev-400).
Java code to reproduce problem:
import java.sql.*;
public class Main {
public static void main(String[] args) throws Exception {
Class.forName("org.postgresql.Driver");
Connection con =
DriverManager.getConnection("jdbc:postgresql://localhost/pguser", "pguser",
"");
Statement stmt = con.createStatement();
stmt.execute("DROP TABLE mytable");
stmt.execute("CREATE TABLE mytable (bi BIGINT)");
System.out.println("We get "+
stmt.executeQuery("select * from
mytable").getMetaData().getPrecision(1)+
" but should get 19");
}
}
From | Date | Subject | |
---|---|---|---|
Next Message | James Doherty | 2005-06-10 15:29:58 | BUG #1713: dbmirror replaces nextval, setval functions |
Previous Message | david.tulloh | 2005-06-10 00:45:26 | BUG #1711: psql doesn't format nicely with newlines |