Bug #801: now() in transaction

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #801: now() in transaction
Date: 2002-10-18 11:23:29
Message-ID: 20021018112329.B000D475AA1@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bhuvan A (bhuvansql(at)myrealbox(dot)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 in 7.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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruno Wolff III 2002-10-18 13:06:30 Re: Bug #801: now() in transaction
Previous Message pgsql-bugs 2002-10-18 09:38:14 Bug #800: Bad free in function PQclear