X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C945D1B193 for ; Fri, 2 Jul 2004 03:11:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17880-06 for ; Fri, 2 Jul 2004 06:11:25 +0000 (GMT) Received: from fed1rmmtao03.cox.net (fed1rmmtao03.cox.net [68.230.241.36]) by svr1.postgresql.org (Postfix) with ESMTP id 3B158D1B373 for ; Fri, 2 Jul 2004 03:11:22 -0300 (ADT) Received: from toolsmythes01 ([68.104.237.49]) by fed1rmmtao03.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with SMTP id <20040702061118.FKQX7678.fed1rmmtao03.cox.net@toolsmythes01>; Fri, 2 Jul 2004 02:11:18 -0400 Reply-To: From: "John Pagakis" To: "Kris Jurka" Cc: Subject: Re: Issue with now() within a transaction in pg74.213.jdbc.jar Date: Thu, 1 Jul 2004 23:17:04 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.9 tagged_above=0.0 required=5.0 tests=BANG_QUOTE, LINES_OF_YELLING, RCVD_IN_SORBS X-Spam-Level: ** X-Archive-Number: 200407/12 X-Sequence-Number: 10396 Kris (sorry for the second copy; forgot to cc pgsql-jdbc@postgresql.org with this) - That did it. Thanks so much!! Odd though. There seems to be a bug in the cygwin implementation of postgres. Tim McAuley ran into the same problem I did and posted here: http://groups.google.com/groups?q=cast+timeofday+timestamp&hl=en&lr=&ie=UTF- 8&selm=bgdif2%2414kk%241%40FreeBSD.csie.NCTU.edu.tw&rnum=5 To save you from having to follow the link - an attempt to cast TIMEOFDAY() to TIMESTAMP in cygwin's implementation results in: ERROR: Bad timestamp external representation 'Thu Jul 01 22:29:25.402375 2004 USMST' Here's what I did to get around it. Perhaps someone out there has a more elegant solution (and if so I'm all ears because I hate this hack): SELECT CAST( SUBSTRING( TIMEOFDAY() FROM 1 FOR 31 ) AS TIMESTAMP ); It looks like the CAST problem is a cygwin-only issue. Thanks again Kris!! __________________________________________________________________ John Pagakis Email: ih8spam_thebfh@toolsmythe.com remove the ih8spam_ and you'll find me "Think enough and you won't know anything." -- Kenneth Patchen This signature generated by ... and I Quote!!(tm) Copyright (c) 1999 SpaZmodic Frog Software, Inc. www.spazmodicfrog.com -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Kris Jurka Sent: Thursday, July 01, 2004 4:58 PM To: John Pagakis Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Issue with now() within a transaction in pg74.213.jdbc.jar On Thu, 1 Jul 2004, John Pagakis wrote: > Most of my tables have a last update date and during some testing in > Postgres 7.4.1 I noticed that the last_update date was slightly in the past > for anything updated within a transaction. The amount it is off by seems to > vary: as little as 30 seconds; as much as a couple of minutes. > This is not a JDBC issue. now() always returns the time from the start of the transaction. If you want current wall clock time use timeofday(). Kris Jurka ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly