pgsql: to_char(float4/8): zero pad to specified length

Started by Bruce Momjianover 11 years ago6 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

to_char(float4/8): zero pad to specified length

Previously, zero padding was limited to the internal length, rather than
the specified length. This allows it to match to_char(int/numeric), which
always padded to the specified length.

Regression tests added.

BACKWARD INCOMPATIBILITY

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cc0d90b73b2e6dd2f301d46818a7265742c41a14

Modified Files
--------------
src/backend/utils/adt/formatting.c | 114 ++++++++++++++++++++++-----------
src/test/regress/expected/numeric.out | 70 ++++++++++++++++++++
src/test/regress/expected/window.out | 2 +-
src/test/regress/sql/numeric.sql | 17 +++++
4 files changed, 163 insertions(+), 40 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: pgsql: to_char(float4/8): zero pad to specified length

Bruce Momjian <bruce@momjian.us> writes:

to_char(float4/8): zero pad to specified length

The Windows members of the buildfarm seem unimpressed with this patch.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: pgsql: to_char(float4/8): zero pad to specified length

I wrote:

Bruce Momjian <bruce@momjian.us> writes:

to_char(float4/8): zero pad to specified length

The Windows members of the buildfarm seem unimpressed with this patch.

castoroides and protosciurus (Solaris) don't like it either, though
the symptom is different.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: pgsql: to_char(float4/8): zero pad to specified length

On Sun, Mar 22, 2015 at 10:39:32AM -0400, Tom Lane wrote:

I wrote:

Bruce Momjian <bruce@momjian.us> writes:

to_char(float4/8): zero pad to specified length

The Windows members of the buildfarm seem unimpressed with this patch.

castoroides and protosciurus (Solaris) don't like it either, though
the symptom is different.

Yeah, I just replied on the other thread --- not good. Maybe we need to
punt this change to 9.6 --- I don't know.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: pgsql: to_char(float4/8): zero pad to specified length

Bruce Momjian <bruce@momjian.us> writes:

On Sun, Mar 22, 2015 at 10:39:32AM -0400, Tom Lane wrote:

castoroides and protosciurus (Solaris) don't like it either, though
the symptom is different.

Yeah, I just replied on the other thread --- not good. Maybe we need to
punt this change to 9.6 --- I don't know.

Given the amount of pink in the buildfarm, I think you need to revert
these changes for the moment. We can take a closer look at them and
maybe figure out what is wrong, but not under time pressure.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#5)
Re: pgsql: to_char(float4/8): zero pad to specified length

On Sun, Mar 22, 2015 at 12:13:28PM -0400, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

On Sun, Mar 22, 2015 at 10:39:32AM -0400, Tom Lane wrote:

castoroides and protosciurus (Solaris) don't like it either, though
the symptom is different.

Yeah, I just replied on the other thread --- not good. Maybe we need to
punt this change to 9.6 --- I don't know.

Given the amount of pink in the buildfarm, I think you need to revert
these changes for the moment. We can take a closer look at them and
maybe figure out what is wrong, but not under time pressure.

Agreed --- reverted. I will work on an updated version that hopefully
can be tested on possible problem platforms.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers