Fix to_char(), to_date(), and to_timestamp() to handle negative/BC
Bruce Momjian <bruce@momjian.us>
Fix to_char(), to_date(), and to_timestamp() to handle negative/BC century specifications just like positive/AD centuries. Previously the behavior was either wrong or inconsistent with positive/AD handling. Centuries without years now always assume the first year of the century, which is now documented.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +3 −1 |
| src/backend/utils/adt/formatting.c | modified | +32 −17 |
| src/test/regress/expected/timestamp.out | modified | +2 −2 |
| src/test/regress/expected/timestamptz.out | modified | +2 −2 |