Received: from barry.xythos.com (sdsl-216-36-111-249.dsl.lax.megapath.net [216.36.111.249]) by postgresql.org (Postfix) with ESMTP id 2F0C747594C for ; Fri, 1 Mar 2002 13:34:42 -0500 (EST) Received: from xythos.com (localhost.localdomain [127.0.0.1]) by barry.xythos.com (8.11.6/8.11.6) with ESMTP id g21GvgN01855; Fri, 1 Mar 2002 08:57:43 -0800 Message-ID: <3C7EE856.9000800@xythos.com> Date: Thu, 28 Feb 2002 18:32:54 -0800 From: Barry Lind User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: Andreas Joseph Krogh Cc: pgsql-jdbc@postgresql.org Subject: Re: [SQL] Timestamp output References: <20020226223623.L56253-100000@houston.familyhealth.com.au> <20020226175601.0944123FA1@dell-laptop01.officenet.no> <3C5FBB0C.9060304@xythos.com> <20020227222917.9BE5E3E2EE@dell-laptop01.officenet.no> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/9 X-Sequence-Number: 3249 Andreas, I can't reproduce the problem you are seeing. I created a table 'test' with one column of type timestamp. Inserted one row with the value from now(). And then ran a simple jdbc program to select out that one row. This all worked without errors. Again I ask are you using the latest 7.2 driver? I know there where some bugs in earlier 7.2 drivers (I think in all of the betas actually) that look similar to the problem you are reporting. thanks, --Barry Andreas Joseph Krogh wrote: > On Tuesday 05 February 2002 11:59, you wrote: > >>Andreas, >> >>Are you using the latest 7.2 driver? I don't have any problems with >>this using the latst 7.2 driver. If you are using the latest driver, >>can you send in a test case that reproduces this problem? >> > > I have the following table: > CREATE TABLE FORUMARTICLE( > ARTICLEID SERIAL NOT NULL PRIMARY KEY, > FORUMID INTEGER NOT NULL REFERENCES FORUM(FORUMID), > CATEGORYID INTEGER NOT NULL REFERENCES CATEGORY(CATEGORYID), > SUBJECT VARCHAR(512) NOT NULL, > LEADTEXT VARCHAR(4000), > BODY VARCHAR(4000) NOT NULL, > USERNAME VARCHAR(64) NOT NULL, > CREATED TIMESTAMP DEFAULT 'now' NOT NULL, > LASTPOSTING TIMESTAMP, > LASTPOSTINGBY VARCHAR(64), > ISAPPROVED INTEGER DEFAULT 0 NOT NULL, > APPROVEDBY INTEGER DEFAULT 0 NOT NULL > ); > > I have the following trigger on FORUMARTICLE: > CREATE FUNCTION stamp_article () RETURNS OPAQUE AS ' > BEGIN > -- Check that lastpostingby is given > IF NEW.LASTPOSTINGBY ISNULL THEN > RAISE EXCEPTION ''LASTPOSTINGBY cannot be NULL value''; > END IF; > > -- Remember when LASTPOSTINGBY changed > NEW.LASTPOSTING := ''now''; > RETURN NEW; > END; > ' LANGUAGE 'plpgsql'; > > CREATE TRIGGER stamp_article BEFORE UPDATE ON FORUMARTICLE > FOR EACH ROW EXECUTE PROCEDURE stamp_article(); > > This causes the follogin entry in FORUMARTICLE: > > lastposting > ------------------------------ > 2002-02-26 18:32:54.83294+01 > > which throws the Exception in the JDBC driver as follows: > > Bad Timestamp Format at 23 in 2002-02-26 18:32:54.83294+01 > > I have the postgresql.jar from 7.2 in my classpath: > > diff ~/postgresql-7.2/src/interfaces/jdbc/jars/postgresql.jar > ~/catalina/common/lib/postgresql.jar > > echo $? > 0 > > >