pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a355dde4df2b6360bbe1292c22061e948d9d0ee0

Modified Files
--------------
doc/src/sgml/func.sgml                | 12 +++++++++---
src/backend/utils/adt/numeric.c       | 16 ++++++++++++++++
src/test/regress/expected/numeric.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql      | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/68b927397e7641432078b2fcfa8f1f5f60a9a42d

Modified Files
--------------
doc/src/sgml/func/func-formatting.sgml | 12 +++++++++---
src/backend/utils/adt/numeric.c        | 16 ++++++++++++++++
src/test/regress/expected/numeric.out  | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql       | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e56e83211f44703d5e03b00f8e66e777d2d5fdbd

Modified Files
--------------
doc/src/sgml/func/func-formatting.sgml | 12 +++++++++---
src/backend/utils/adt/numeric.c        | 16 ++++++++++++++++
src/test/regress/expected/numeric.out  | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql       | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cdd975becc5f378269e1d5bec71c2804d775ccab

Modified Files
--------------
doc/src/sgml/func.sgml                | 12 +++++++++---
src/backend/utils/adt/numeric.c       | 16 ++++++++++++++++
src/test/regress/expected/numeric.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql      | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4751b0490ea4965dab302b1c8e7ac7db9be3f466

Modified Files
--------------
doc/src/sgml/func.sgml                | 12 +++++++++---
src/backend/utils/adt/numeric.c       | 16 ++++++++++++++++
src/test/regress/expected/numeric.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql      | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix formatting of to_char's EEEE output for numeric and bigint.
@ 2026-11-18 17:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2026-11-18 17:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix formatting of to_char's EEEE output for numeric and bigint.

The integer and float code paths for EEEE format always produce a
single digit before the decimal point.  However, the numeric code
path (shared by bigint) was careless about rounding: if rounding
increased the value from, say, 9.999 to 10.00, it got printed
that way.  Fix that.  Given the precedent of the other code paths,
this seems incontestably a bug, so back-patch.

While at it, provide some actual documentation about what this
format code is supposed to do, rather than leaving it to the
reader's imagination.

Author: Jianqiao Han <hanjianqiao@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAPOa_Zkc1QROJwB_JcB+f=6s1bUPRh7qr_H_=B_S-KZPa0V1DA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a9e88fab7f0188af4f0bc0e4b656cf23d79ff2da

Modified Files
--------------
doc/src/sgml/func.sgml                | 12 +++++++++---
src/backend/utils/adt/numeric.c       | 16 ++++++++++++++++
src/test/regress/expected/numeric.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/numeric.sql      | 13 +++++++++++++
4 files changed, 62 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-18 17:45 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>
2026-11-18 17:45 pgsql: Fix formatting of to_char's EEEE output for numeric and bigint. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox