pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Lind <barry@xythos.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [SQL] Timestamp output
Date: Thu, 28 Feb 2002 18:32:54 -0800
Message-ID: <3C7EE856.9000800@xythos.com> (raw)
References: <20020226223623.L56253-100000@houston.familyhealth.com.au>
	<20020226175601.0944123FA1@dell-laptop01.officenet.no>
	<3C5FBB0C.9060304@xythos.com>
	<20020227222917.9BE5E3E2EE@dell-laptop01.officenet.no>

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
> 
> 
> 






view thread (9+ messages)  latest in thread

Message-ID: <3C7EE856.9000800@xythos.com>
Permalink:  ../3C7EE856.9000800@xythos.com/
Also on:    postgresql.org/message-id/3C7EE856.9000800@xythos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barry@xythos.com, andreak@officenet.no, pgsql-jdbc@postgresql.org
  Subject: Re: [SQL] Timestamp output
  In-Reply-To: <3C7EE856.9000800@xythos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox