Bug #801: now() in transaction - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #801: now() in transaction
Date
Msg-id 20021018112329.B000D475AA1@postgresql.org
Whole thread Raw
Responses Re: Bug #801: now() in transaction  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-bugs
Bhuvan A (bhuvansql@myrealbox.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
now() in transaction

Long Description
I am using 7.2.1. now() returns same value ever, within transaction. If we use now() say 10 times in the same
transaction,all 10 times we are getting the same value, irrespect of the interval. 7.2 too behaves similar.  

AFAIK, we had similar problem in plpgsql in 7.1 and earlier. The constant values interpreted within begin block(in
plpgsql)was used on all invocations of the function, during the lifetime of backend. This behaviour have been changed
in7.2 and it behaves how the programmer expect it to! But why it should happen in normal transaction now? 

Kindly apologize, if my understanding is wrong.

regards,
bhuvaneswaran


Sample Code
bhuvan=> begin;
BEGIN
bhuvan=> select now();
               now
---------------------------------
2002-10-18 16:36:41.071665+05:30
bhuvan=> -- wait for few seconds
bhuvan=> select now();
               now
---------------------------------
2002-10-18 16:36:41.071665+05:30
bhuvan=> -- wait for few seconds
bhuvan=> select now();
               now
---------------------------------
2002-10-18 16:36:41.071665+05:30
bhuvan=> -- wait for few seconds
bhuvan=> select now();
               now
---------------------------------
2002-10-18 16:36:41.071665+05:30
bhuvan=> rollback;
ROLLBACK
bhuvan=>

No file was uploaded with this report

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #800: Bad free in function PQclear
Next
From: Bruno Wolff III
Date:
Subject: Re: Bug #801: now() in transaction