|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.162 2005/10/15 01:47:11 neilc Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.163 2005/10/22 19:33:57 tgl Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <chapter id="datatype">
|
@@ -1367,16 +1367,16 @@ SELECT b, char_length(b) FROM test2;
|
1367 | 1367 | <entry><type>time [ (<replaceable>p</replaceable>) ] [ without time zone ]</type></entry>
|
1368 | 1368 | <entry>8 bytes</entry>
|
1369 | 1369 | <entry>times of day only</entry>
|
1370 |
| - <entry>00:00:00.00</entry> |
| 1370 | + <entry>00:00:00</entry> |
1371 | 1371 | <entry>24:00:00</entry>
|
1372 | 1372 | <entry>1 microsecond / 14 digits</entry>
|
1373 | 1373 | </row>
|
1374 | 1374 | <row>
|
1375 | 1375 | <entry><type>time [ (<replaceable>p</replaceable>) ] with time zone</type></entry>
|
1376 | 1376 | <entry>12 bytes</entry>
|
1377 | 1377 | <entry>times of day only, with time zone</entry>
|
1378 |
| - <entry>00:00:00.00+12</entry> |
1379 |
| - <entry>24:00:00-12</entry> |
| 1378 | + <entry>00:00:00+1359</entry> |
| 1379 | + <entry>24:00:00-1359</entry> |
1380 | 1380 | <entry>1 microsecond / 14 digits</entry>
|
1381 | 1381 | </row>
|
1382 | 1382 | </tbody>
|
@@ -1759,19 +1759,22 @@ January 8 04:05:06 1999 PST
|
1759 | 1759 |
|
1760 | 1760 | <para>
|
1761 | 1761 | The <acronym>SQL</acronym> standard differentiates <type>timestamp without time zone</type>
|
1762 |
| - and <type>timestamp with time zone</type> literals by theexistence of a |
1763 |
| - <quote>+</quote>; or <quote>-</quote>. Hence, according to the standard, |
| 1762 | + and <type>timestamp with time zone</type> literals by thepresence of a |
| 1763 | + <quote>+</quote> or <quote>-</quote>. Hence, according to the standard, |
1764 | 1764 | <programlisting>TIMESTAMP '2004-10-19 10:23:54'</programlisting>
|
1765 | 1765 | is a <type>timestamp without time zone</type>, while
|
1766 | 1766 | <programlisting>TIMESTAMP '2004-10-19 10:23:54+02'</programlisting>
|
1767 | 1767 | is a <type>timestamp with time zone</type>.
|
1768 |
| - <productname>PostgreSQL</productname> |
1769 |
| - differs from the standard by requiring that <type>timestamp with time zone</type> |
1770 |
| - literals be explicitly typed: |
| 1768 | + <productname>PostgreSQL</productname> never examines the content of a |
| 1769 | + literal string before determining its type, and therefore will treat |
| 1770 | + both of the above as <type>timestamp without time zone</type>. To |
| 1771 | + ensure that a literal is treated as <type>timestamp with time |
| 1772 | + zone</type>, give it the correct explicit type: |
1771 | 1773 | <programlisting>TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'</programlisting>
|
1772 |
| - If a literal is not explicitly indicated as being of <type>timestamp with time zone</type>, |
1773 |
| - <productname>PostgreSQL</productname> will silently ignore any time zone indication in the literal. |
1774 |
| - That is, the resulting date/time value is derived from the date/time |
| 1774 | + In a literal that has been decided to be <type>timestamp without time |
| 1775 | + zone</type>, <productname>PostgreSQL</productname> will silently ignore |
| 1776 | + any time zone indication. |
| 1777 | + That is, the resulting value is derived from the date/time |
1775 | 1778 | fields in the input value, and is not adjusted for time zone.
|
1776 | 1779 | </para>
|
1777 | 1780 |
|
|