|
|||||||||||
|
[NOVICE] Is now() atomic?
From: Michael Lush <mjlush(at)ebi.ac.uk>
Date: Thu Dec 13 2007 - 11:32:57 EST I'm writing a reporting script (on postgres 8.1) that logs some table stats along with the time, I'd like to write something like this:- SELECT now(), foo, COUNT(*) FROM table GROUP BY foo; now | foo | count --------------------------------+-------+------- 13/12/2007 16:04:49.044687 GMT | A | 2149913/12/2007 16:04:49.044687 GMT | B | 2517 13/12/2007 16:04:49.044687 GMT | C | 245 . . 13/12/2007 16:04:49.044687 GMT | ZZZ | 23016 Does now() record the time that the SELECT statement was executed or the time that the row is printed out? ie is it possible for the clock to tick during the SELECT resulting in:- now | foo | count --------------------------------+-------+-------13/12/2007 16:04:49.044687 GMT | A | 21499 . . 13/12/2007 16:04:49.044688 GMT | ZZZ | 23016 -- Michael ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Michael John Lush PhD Tel:44-1223 492626 Bioinformatician HUGO Gene Nomenclature Committee Email: hgnc@genenames.org European Bioinformatics Institute Hinxton, Cambridge URL: http://www.genenames.org ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not matchReceived on Thu Dec 13 11:34:24 2007 This archive was generated by hypermail 2.1.8 : Thu Jun 19 2008 - 00:04:37 EDT |
||||||||||
|
|||||||||||