pgsql: to_char(): Do not count negative sign as a digit for time values

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: to_char(): Do not count negative sign as a digit for time values
Date: 2015-10-06 00:51:54
Message-ID: E1ZjGTy-0005M4-So@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

to_char(): Do not count negative sign as a digit for time values

For time masks, like HH24, MI, SS, CC, MM, do not count the negative
sign as part of the zero-padding length specified by the mask, e.g. have
to_char('-4 years'::interval, 'YY') return '-04', not '-4'.

Report by Craig Ringer

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2d87eedc1d4468d331035bbe55f140f180d20144

Modified Files
--------------
src/backend/utils/adt/formatting.c | 28 ++++++++++++++++++----------
src/test/regress/expected/timestamp.out | 6 +++---
src/test/regress/expected/timestamptz.out | 6 +++---
3 files changed, 24 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2015-10-06 00:56:46 pgsql: psql: allow \pset C in setting the title, matches \C
Previous Message Tom Lane 2015-10-05 19:20:35 pgsql: Stamp 9.0.23.