Re: [SQL] Timestamp output
От | Barry Lind |
---|---|
Тема | Re: [SQL] Timestamp output |
Дата | |
Msg-id | 3C7EE856.9000800@xythos.com обсуждение исходный текст |
Ответы |
Re: [SQL] Timestamp output
|
Список | pgsql-jdbc |
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 > > >
В списке pgsql-jdbc по дате отправления: