diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-09-06 03:22:42 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-09-06 03:22:42 +0000 |
commit | 2a34134b6c5a46d8f905a82af51c55a7ec91ecac (patch) | |
tree | a791f893a03000fb533ea1efecd313c7478de2c1 /doc/src | |
parent | 74dde13e2c5bab897ec2cd0b50e92cfae83f8109 (diff) | |
download | postgresql-2a34134b6c5a46d8f905a82af51c55a7ec91ecac.tar.gz postgresql-2a34134b6c5a46d8f905a82af51c55a7ec91ecac.zip |
- new to_char(interval, text)
- new millisecond (ms) and microsecond (us) support
- more robus parsing from string - used is separator checking for
non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD')
- SGML docs are included
Karel Zak
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2c2daa11a02..39996e54c39 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.68 2001/08/31 07:45:09 ishii Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.69 2001/09/06 03:22:41 momjian Exp $ --> <chapter id="functions"> <title>Functions and Operators</title> @@ -1565,6 +1565,12 @@ <entry>to_char(timestamp 'now','HH12:MI:SS')</entry> </row> <row> + <entry>to_char(interval, text)</entry> + <entry>text</entry> + <entry>convert interval to string</entry> + <entry>to_char(interval '15h 2m 12s','HH24:MI:SS')</entry> + </row> + <row> <entry>to_char(int, text)</entry> <entry>text</entry> <entry>convert int4/int8 to string</entry> @@ -1646,6 +1652,14 @@ <entry>second (00-59)</entry> </row> <row> + <entry>MS</entry> + <entry>millisecond (000-999)</entry> + </row> + <row> + <entry>US</entry> + <entry>microsecond (000000-999999)</entry> + </row> + <row> <entry>SSSS</entry> <entry>seconds past midnight (0-86399)</entry> </row> @@ -1911,6 +1925,23 @@ <literal>to_date('20000Nov31', 'YYYYMonDD')</literal>. </para> </listitem> + + <listitem> + <para> + Millisecond <literal>MS</literal> and microcesond <literal>US</literal> + values are in conversion from string to timestamp used as part of + second after decimal point. For example + <literal>to_timestamp('12:3', 'SS:MS')</literal> is not 3 milliseconds, + but 300, because the conversion count it as <literal>12 + 0.3</literal>. + It means for format 'SS:MS' is '12:3' or '12:30' or '12:300' same + number of miliceconds. For the three milliseconds must be used + '12:003' that the counversion count as + <literal> 12 + 0.003 = 12.003 seconds </literal>. Here is a more + complex example: + <literal>to_timestamp('15:12:02.020.001230','HH:MI:SS.MS.US')</literal> + is 15 hours, 12 minutes, 2.021230 seconds. + </para> + </listitem> </itemizedlist> </para> |