Bug#612643: libpg-java: setNull on timestamp fields assumes timestamp with timezone

Jan Niehusmann jan at gondor.com
Wed Feb 9 18:13:02 UTC 2011


Package: libpg-java
Version: 8.4-701-1
Severity: normal

When calling AbstractJdbc2Statement.setNull on a timestamp value, the
driver assumes the field has a type of timestamp with timezone.
This usually works, but in some cases it has ill effects. One is described 
at http://archives.postgresql.org/pgsql-jdbc/2010-02/msg00012.php

I just found another case: When calling a stored procedure with a
"timestamp witout timezone" parameter, and setting that parameter to
null, I get an error message:

2011-02-09 18:28:51 CET ERROR:  function my_function(numeric, numeric, timestamp with time zone) does not exist at character 15
2011-02-09 18:28:51 CET HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

This behaviour is fixed with upstream version 8.4-702 (which I verified
by applying the following patch from CVS manually).

So please consider upgrading to a more recent version.


===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v
retrieving revision 1.114.2.1
retrieving revision 1.114.2.2
diff -u -p -r1.114.2.1 -r1.114.2.2
--- jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java	2009/09/26 15:21:27	1.114.2.1
+++ jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java	2010/05/01 16:08:00	1.114.2.2
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2008, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.114 2009/05/27 23:55:19 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.114.2.1 2009/09/26 15:21:27 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -1109,10 +1109,8 @@ public abstract class AbstractJdbc2State
             oid = Oid.DATE;
             break;
         case Types.TIME:
-            oid = Oid.TIME;
-            break;
         case Types.TIMESTAMP:
-            oid = Oid.TIMESTAMPTZ;
+            oid = Oid.UNSPECIFIED;
             break;
         case Types.BIT:
             oid = Oid.BOOL;



-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'oldstable'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-smapi-x61s-amd64-03744-gcedf01f (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libpg-java depends on:
ii  default-jre-headless [java2 1:1.6-40     Standard Java or Java compatible R
ii  gcj-4.4-jre-headless [java2 4.4.5-2      Java runtime environment using GIJ
ii  gcj-jre-headless [java2-run 4:4.4.5-1    Java runtime environment using GIJ
ii  gij-4.3 [java2-runtime-head 4.3.2-2      The GNU Java bytecode interpreter
ii  openjdk-6-jre-headless [jav 6b18-1.8.3-2 OpenJDK Java runtime, using Hotspo
ii  sun-java6-jre [java2-runtim 6.22-1       Sun Java(TM) Runtime Environment (

libpg-java recommends no packages.

Versions of packages libpg-java suggests:
ii  postgresql               8.4.5-0squeeze2 object-relational SQL database (su

-- no debconf information





More information about the pkg-java-maintainers mailing list