Clean up the ancient decision to show only two fractional-seconds digits
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Nov 2008 01:36:20 +0000 (01:36 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Nov 2008 01:36:20 +0000 (01:36 +0000)
commit1656b9ae4ada6891f0c9df82e9e8579f77caf17a
treecf70d54e1a215bc061bb0a6777899ee9c5726c26
parenta12603d90410a65740804cb35f2382c94cd9e748
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
src/backend/utils/adt/datetime.c
src/test/regress/expected/horology.out
src/test/regress/expected/interval.out
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/sql/interval.sql