From: | Barry Lind <barry(at)xythos(dot)com> |
---|---|
To: | Andreas Joseph Krogh <andreak(at)officenet(dot)no> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: [SQL] Timestamp output |
Date: | 2002-03-01 02:32:54 |
Message-ID: | 3C7EE856.9000800@xythos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc pgsql-sql |
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
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | tony | 2002-03-01 06:58:00 | Re: Postgress 7.2 and j2sdk 1.4.0 |
Previous Message | Dave Cramer | 2002-03-01 01:57:22 | Re: JDBC driver in Windows machines |
From | Date | Subject | |
---|---|---|---|
Next Message | Marc Polatschek | 2002-03-01 09:54:02 | Re: SQL statement : list table details |
Previous Message | Alexander Steinert | 2002-02-28 22:56:17 | Re: Large Objects |