On Wed, 5 Jun 2002, Colin Mangiagalli wrote:
> Hi,
>
> My implementation of Postgresql is as followes:
>
> Postgresql Version: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC
> 2.95.3-5
> Cygwin dll: 1.3.10
> Operating system: Windows 2000 Service Pack 2
> Processor: Intel Pentium III 1 Ghz
> Bios: Award Moduler Bios v6.00pg
>
> When I start postmaster and run 'select CURRENT_TIMESTAMP;', the date
> and time
> are correct. After a hour, I run 'select CURRENT_TIMESTAMP;' and see
> that the
> time is not the same as the system clock, in fact it is quite far
> behind.
>
> Can someone please tell me what could possibly be causing this.
CURRENT_TIMESTAMP returnst the timestamp at the start of the current
transaction. Almost certainly, you're starting a transaction, checking the
time, waiting a while, then checking the time again. Outside of a
transaction (or after the close of a transaction), CURRENT_TIMESTAMP will
be updated.
If you absolutely want the real time, regardless of transactinons, you
timeofday().
- J.
--
Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant