Re: current_timestamp wrong

From: Peter Pilsl <pilsl(at)goldfisch(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: current_timestamp wrong
Date: 2001-08-23 10:55:11
Message-ID: 20010823125511.D74681@i3.atat.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 22, 2001 at 06:26:14PM -0400, Tom Lane wrote:

>
> current_timestamp is defined as the time of the start of the current
> transaction (this is not a bug, it's a feature).
>
> If your program is set up to hold a transaction open while it's idle,
> that could cause stale-looking values of current_timestamp when you
> finally do something in the transaction. Unfortunately I believe that
> "autocommit off" mode in the DBD driver does exactly that.
>

the DBD-Driver does not support explicit begin-transactions. Instead
every commit and rollbackstatement issues implicit a new
begin-statement when autocommit off. (The same has obviously to
happen, when the databasehandle is opened, but it is not documented)
This and your explanation about the meaning of current_timestamp is
the perfect explanation of our bug.

I just created a fix by just issuing a rollback-statement at the
*beginning* of each workingsession. This should start a new
transaction and - I hope - dont loose to much performance. When its
working, I'll contact Edmund Mergl, author of DBD::Pg and try to find
a better solution.

I personally would prefer a solution where one must issue explicit
begin and commit/rollback and each action in between will cause an
error when autocommit->off.

thnx a lot.
peter

--
mag. peter pilsl

phone: +43 676 3574035
fax : +43 676 3546512
email: pilsl(at)goldfisch(dot)at
sms : pilsl(at)max(dot)mail(dot)at

pgp-key available

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bhuvaneswari 2001-08-23 11:22:14 Regarding vacuumdb
Previous Message Carfield Yim 2001-08-23 09:36:49 Where can I find more information of MVCC?