Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:00:34+00:00 2026-06-15T21:00:34+00:00

My application currently uses the Postgres 8.2 JDBC driver (with Postgres 8.2 database), but

  • 0

My application currently uses the Postgres 8.2 JDBC driver (with Postgres 8.2 database), but we are upgrading to Java 7 and the JDBC 4 driver, which is currently the 9.2-1002 release. The ultimate configuration will be the JDBC 9.2 driver with Postgres 8.2 database.

There is an exception being thrown in one of our trigger functions, and it only occurs when running with the 9.2 driver. This is an ON UPDATE trigger on another table. The trigger effectively does:

DECLARE
    mytime bigint;
BEGIN
    SELECT INTO mytime EXTRACT(EPOCH FROM current_timestamp(3))*1000;
    UPDATE resource SET lastmodified=mytime WHERE id=NEW.resource_id;
END

The resource.lastmodified column is defined as type BIGINT.

The SQL error that occurs is:

ERROR: invalid input syntax for integer: "1355248911435.9998"
    Where: PL/pgSQL function "f_modify_resource" line 4 at SQL statement;

Obviously the error is in the SELECT INTO line; there should be a cast to BIGINT here. However, I’m wondering why the statement succeeds with the 8.2 JDBC driver, but fails with the 9.2 driver when nothing else has changed? Since the trigger code runs inside the database, shouldn’t this all be transparent to the JDBC driver? I thought that PostgreSQL would continue to do an implicit cast here, but it seems to have stopped.

I’ve tried setting compatible=8.2 on the JDBC connection URL with no effect also.

Edit
Here’s the output in the statement log when running with the 9.2-1002.jdbc4 driver (and I can confirm that this occurs at least as far back as the 9.0 driver, possibly earlier):

STATEMENT:  UPDATE message SET hastext='true' WHERE rid='2-1355323570239' AND mid='1-1355329102968'
ERROR:  22P02: invalid input syntax for integer: "1355329102985.0002"
CONTEXT:  PL/pgSQL function "f_modify_resource" line 4 at SQL statement
LOCATION:  scanint8, int8.c:137

The f_modify_resource function is run by an ON UPDATE trigger on the message table, and its body is exactly as given above. Line 4 corresponds to the SELECT INTO statement. I can confirm that the EXTRACT(EPOCH...) does indeed return a double precision, and it should indeed.

With the 8.2 (jdbc4 and jdbc3) driver, this error does not occur, and statements process correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:00:36+00:00Added an answer on June 15, 2026 at 9:00 pm

    Check to see if the JDBC driver is setting *extra_float_digits*. The release notes say that as of 8.3-dev602 it is set to ‘2’ upon connection whereas it normally defaults to zero. I can’t reproduce your behavior (all I have is 9.1 and 9.2 to test with). However, I can do this:

    postgres=# set extra_float_digits = 2;
    SET
    postgres=# select extract(epoch from current_timestamp(3));
         date_part      
    --------------------
     1355346251.7550001
    (1 row)
    
    postgres=# select extract(epoch from current_timestamp(3));
         date_part      
    --------------------
     1355346253.1619999
    (1 row)
    

    I can’t get this to fail when multiplying by 1000 and assigning to a BIGINT, but that may be something that is 8.2-specific, so you’ll have to test by using the 9.2 driver and explicitly running the statement SET extra_float_digits = 0 after you finish connecting, but before running the query that’s failing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java SE application, and it uses a database. I am currently
My application has a model which currently uses an integer in the SQL database
We are developing an ASP.NET MVC Application that currently uses it's own database ApplicationData
I'm currently working on a PHP application that uses a MySQL database for its
I am currently working on a sample application which uses QNetworkAccessManager to send the
Currently I am dealing with a web application which uses a txt file as
I am currently writing an API and an application which uses the API. I
I am looking at re-writing an application (currently in C) which uses HIS 2004
I am looking at porting a Java application to .NET, the application currently uses
We have a desktop application written in Java Swing that currently uses Java Web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.