> I've tried to measure the duration of sql with printing out
> "localtimestamp"  but for some reason during the same pg/plsql call 
> it returns the same value:


>From http://www.postgresql.org/docs/current/static/functions-datetime.html:

There is also the function timeofday(), which for historical reasons returns 
a text string rather than a timestamp value: 

SELECT timeofday();
 Result: Sat Feb 17 19:07:32.000126 2001 EST

It is important to know that CURRENT_TIMESTAMP and related functions return 
the start time of the current transaction; their values do not change during 
the transaction. This is considered a feature: the intent is to allow a 
single transaction to have a consistent notion of the "current" time, so that 
multiple modifications within the same transaction bear the same time stamp. 
timeofday() returns the wall-clock time and does advance during transactions. 


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to