Clean up the ancient decision to show only two fractional-seconds digits
Tom Lane <tgl@sss.pgh.pa.us>
Clean up the ancient decision to show only two fractional-seconds digits in "postgres_verbose" intervalstyle, and the equally arbitrary decision to show at least two fractional-seconds digits in most other datetime display styles. This results in some minor changes in the expected regression test outputs. Also, coalesce a lot of repetitive code in datetime.c into subroutines, for clarity and ease of maintenance. In particular this roughly halves the number of #ifdef HAVE_INT64_TIMESTAMP segments. Ron Mayer, with some additional kibitzing from Tom Lane
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/datetime.c | modified | +298 −546 |
| src/test/regress/expected/horology.out | modified | +136 −136 |
| src/test/regress/expected/interval.out | modified | +29 −9 |
| src/test/regress/expected/timestamp.out | modified | +193 −193 |
| src/test/regress/expected/timestamptz.out | modified | +196 −196 |
| src/test/regress/sql/interval.sql | modified | +6 −0 |