|
1 | | -<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.239 2009/06/1721:58:49 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.240 2009/07/08 17:21:55 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="datatype"> |
4 | 4 | <title id="datatype-title">Data Types</title> |
@@ -1524,11 +1524,11 @@ SELECT b, char_length(b) FROM test2; |
1524 | 1524 | DAY TO MINUTE |
1525 | 1525 | DAY TO SECOND |
1526 | 1526 | HOUR TO MINUTE |
| 1527 | + HOUR TO SECOND |
1527 | 1528 | MINUTE TO SECOND |
1528 | 1529 | </programlisting> |
1529 | | - Input falling outside the specified set of fields is silently discarded. |
1530 | 1530 | Note that if both <replaceable>fields</replaceable> and |
1531 | | - <replaceable>precision</replaceable> are specified, the |
| 1531 | + <replaceable>p</replaceable> are specified, the |
1532 | 1532 | <replaceable>fields</replaceable> must include <literal>SECOND</>, |
1533 | 1533 | since the precision applies only to the seconds. |
1534 | 1534 | </para> |
@@ -2468,11 +2468,15 @@ P <optional> <replaceable>years</>-<replaceable>months</>-<replaceable>days</> < |
2468 | 2468 |
|
2469 | 2469 | <para> |
2470 | 2470 | When writing an interval constant with a <replaceable>fields</> |
2471 | | - specification, or when assigning to an interval column that was defined |
2472 | | - with a <replaceable>fields</> specification, the interpretation of |
| 2471 | + specification, or when assigninga stringto an interval column that was |
| 2472 | +definedwith a <replaceable>fields</> specification, the interpretation of |
2473 | 2473 | unmarked quantities depends on the <replaceable>fields</>. For |
2474 | 2474 | example <literal>INTERVAL '1' YEAR</> is read as 1 year, whereas |
2475 | | - <literal>INTERVAL '1'</> means 1 second. |
| 2475 | + <literal>INTERVAL '1'</> means 1 second. Also, field values |
| 2476 | + <quote>to the right</> of the least significant field allowed by the |
| 2477 | + <replaceable>fields</> specification are silently discarded. For |
| 2478 | + example, writing <literal>INTERVAL '1 day 2:03:04' HOUR TO MINUTE</> |
| 2479 | + results in dropping the seconds field, but not the day field. |
2476 | 2480 | </para> |
2477 | 2481 |
|
2478 | 2482 | <para> |
|