Re:   The jdbc

From: stevegy(at)126(dot)com
To: "tom lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "richard huxton" <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: &nbsp;&nbsp;The&nbsp;jdbc
Date: 2007-01-23 07:10:27
Message-ID: 45B5B4E3.000010.14125@bj126app65.126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I found the point. The auto_commit flag and jdbc connection pool is some of problem and the current_timestamp is not a now() meanful function. I have to use the CAST(timeofday() as timestamp) to.
I refer to the http://archives.postgresql.org/pgsql-jdbc/2006-08/msg00063.php.

Thanks.

Regards, Steve Yao


在2007-01-17,"Tom Lane" 写道:

Richard Huxton <dev(at)archonet(dot)com> writes:
> The time is fixed at the start of the transaction. This lets you do
> several inserts having the same timestamp.

I think there's another problem here, which is that he's declared
"currenttime" as a timestamp without time zone, but the
CURRENT_TIMESTAMP function yields timestamp with time zone,
meaning there's a TimeZone-dependent conversion going on. It sounds
to me like there's a difference between the TimeZone setting between
his web app and his psql, leading to an hour's offset, plus a smaller
offset having to do with time-since-transaction-start.

> See here for details of timeofday() etc.
> http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

And read the preceding chapter's discussion of the different datetime
data types.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-01-23 07:27:28 Re: [HACKERS] Autovacuum Improvements
Previous Message Tom Lane 2007-01-23 06:18:49 Re: New US DST Rules & PostgreSQL