Index: doc/src/sgml/func.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.276 diff -C3 -r1.276 func.sgml *** doc/src/sgml/func.sgml 2 Aug 2005 16:11:56 -0000 1.276 --- doc/src/sgml/func.sgml 7 Aug 2005 13:45:47 -0000 *************** *** 5047,5053 **** current_date date ! Today's date; see --- 5047,5053 ---- current_date date ! Today's date; see *************** *** 5056,5062 **** current_time time with time zone ! Time of day; see --- 5056,5062 ---- current_time time with time zone ! Time of day; see *************** *** 5065,5071 **** current_timestamp timestamp with time zone ! Date and time; see --- 5065,5071 ---- current_timestamp timestamp with time zone ! Date and time; see *************** *** 5121,5126 **** --- 5121,5134 ---- + gettime() + timestamp with time zone + Current system date and time; see + + + + + isfinite(timestamp) boolean Test for finite time stamp (not equal to infinity) *************** *** 5155,5161 **** localtime time ! Time of day; see --- 5163,5169 ---- localtime time ! Time of day; see *************** *** 5164,5170 **** localtimestamp timestamp ! Date and time; see --- 5172,5178 ---- localtimestamp timestamp ! Date and time; see *************** *** 5174,5180 **** now() timestamp with time zone Current date and time (equivalent to ! current_timestamp); see --- 5182,5188 ---- now() timestamp with time zone Current date and time (equivalent to ! current_timestamp); see *************** *** 5183,5189 **** timeofday() text ! Current date and time; see --- 5191,5197 ---- timeofday() text ! Current system date and time (textual representation); see *************** *** 5769,5777 **** current ! ! The following functions are available to obtain the current date and/or ! time: CURRENT_DATE CURRENT_TIME --- 5777,5788 ---- current ! ! Transaction Time ! ! ! The following functions are available to determine the date/time as at the start of the current transaction: ! CURRENT_DATE CURRENT_TIME *************** *** 5811,5818 **** ! ! Some examples: SELECT CURRENT_TIME; Result: 14:39:53.662522-05 --- 5822,5829 ---- ! ! Some examples: SELECT CURRENT_TIME; Result: 14:39:53.662522-05 *************** *** 5829,5882 **** SELECT LOCALTIMESTAMP; Result: 2001-12-23 14:39:53.662522 ! ! ! ! The function now() is the traditional ! PostgreSQL equivalent to ! CURRENT_TIMESTAMP. ! ! ! 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. ! - ! Other database systems may advance these values more ! frequently. - ! ! There is also the function timeofday() which ! returns the wall-clock time and advances during transactions. For ! historical reasons timeofday() returns a ! text string rather than a timestamp ! value: ! ! SELECT timeofday(); ! Result: Sat Feb 17 19:07:32.000126 2001 EST ! ! ! ! All the date/time data types also accept the special literal value ! now to specify the current date and time. Thus, ! the following three all return the same result: ! ! SELECT CURRENT_TIMESTAMP; ! SELECT now(); ! SELECT TIMESTAMP 'now'; -- incorrect for use with DEFAULT ! ! --- 5840,5886 ---- SELECT LOCALTIMESTAMP; Result: 2001-12-23 14:39:53.662522 ! ! ! The function now() is the traditional ! PostgreSQL equivalent to ! CURRENT_TIMESTAMP. ! ! 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. ! ! ! Other database systems may advance these values more ! frequently. ! ! ! ! If you want to access the current time without regard to the current ! transaction, refer to the functions in . ! ! ! ! All the date/time data types also accept the special literal value ! now to specify the current date and time. Thus, ! the following three all return the same result: ! ! SELECT CURRENT_TIMESTAMP; ! SELECT now(); ! SELECT TIMESTAMP 'now'; -- incorrect for use with DEFAULT ! ! *************** *** 5890,5895 **** --- 5894,5934 ---- behavior of defaulting to the time of row insertion. + + + + System Time + + + The following functions are available to determine the current system time directly: + + + gettime() + timeofday() + + + + + gettime() returns type timestamp with time zone at the maximum available precision. + + + + timeofday() returns a long textual representation of the current time type text. + + + + Usage examples: + + SELECT gettime(); + Result: 2005-08-07 21:22:43.495743+10 + + SELECT timeofday(); + Result: Sat Feb 17 19:07:32.000126 2001 EST + + + + +