Skip site navigation (1) Skip section navigation (2)

now() gives the time of the last commit, not the time it is called

From: Talja Ari <Ari(dot)Talja(at)comptel(dot)com>
To: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>
Subject: now() gives the time of the last commit, not the time it is called
Date: 2002-10-16 07:59:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Postgres version: 7.2.1
Platform: Server on Linux, (java-)client on HP-UX.11 and SunOS 5.8
JDBC drivers: For PostgreSQL 7.2, JDK 1.3
JDK version: 1.3.1
Autocommit off for each connection
Special server flags: -i to allow the connections from different host

The program is a java server, which updates a row in the database at regular
intervals. The update time is taken from postgres function now() but the
update time is the time when the connection was created/last transaction
ended. In Oracle the time which is created by 'sysdate' is the time when the
update statement is executed (or the time when the statement is actually
committed. I'm not sure about that because the execution and commit are
called practically at the same time). This causes a delay to the time and
the size of the delay can be almost anything depending on the time how long
the connection has been without any use. The connections are kept in a
connection pool for later use so I cannot trust that the connection is
created or the transaction has ended recently enough. Currently I'm calling
commit before I execute the update statement.

Ari Talja


pgsql-bugs by date

Next:From: ir. F.T.M. van Vugt bc.Date: 2002-10-16 08:05:05
Subject: Re: multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)
Previous:From: Tom LaneDate: 2002-10-16 03:11:55
Subject: Re: spurious "UNIQUE constraint matching given keys for referenced table" error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group