Index: doc/src/sgml/func.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.229 diff -c -r1.229 func.sgml *** doc/src/sgml/func.sgml 3 Dec 2004 18:34:31 -0000 1.229 --- doc/src/sgml/func.sgml 12 Dec 2004 10:07:26 -0000 *************** *** 3989,3994 **** --- 3989,4001 ---- argument is the value to be formatted and the second argument is a template that defines the output or input format. + + The to_timestamp function can also take a single + double precision argument to convert from Unix epoch to + timestamp with time zone. + (Integer Unix epochs are implicitly cast to + double precision.) + Formatting Functions *************** *** 4046,4051 **** --- 4053,4064 ---- to_timestamp('05 Dec 2000', 'DD Mon YYYY') + to_timestamp(double precision) + timestamp with time zone + convert UNIX epoch to time stamp + to_timestamp(200120400) + + to_number(text, text) numeric convert string to numeric Index: src/include/catalog/pg_proc.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/catalog/pg_proc.h,v retrieving revision 1.348 diff -c -r1.348 pg_proc.h *** src/include/catalog/pg_proc.h 7 Oct 2004 18:38:50 -0000 1.348 --- src/include/catalog/pg_proc.h 12 Dec 2004 10:07:27 -0000 *************** *** 1435,1440 **** --- 1435,1442 ---- DESCR("greater-than-or-equal"); DATA(insert OID = 1157 ( timestamptz_gt PGNSP PGUID 12 f f t f i 2 16 "1184 1184" _null_ timestamp_gt - _null_ )); DESCR("greater-than"); + DATA(insert OID = 1158 ( to_timestamp PGNSP PGUID 14 f f t f i 1 1184 "701" _null_ "select ((\'epoch\'::timestamptz + $1 * \'1 second\'::interval) at time zone \'UTC\') at time zone \'UTC\'" - _null_ )); + DESCR("convert UNIX epoch to timestamptz"); DATA(insert OID = 1159 ( timezone PGNSP PGUID 12 f f t f i 2 1114 "25 1184" _null_ timestamptz_zone - _null_ )); DESCR("adjust timestamp to new time zone");