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

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

From
Bruce Momjian
Date:
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(-)


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

From
Tom Lane
Date:
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


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

From
Tom Lane
Date:
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


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

From
Bruce Momjian
Date:
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. +


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

From
Tom Lane
Date:
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


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

From
Bruce Momjian
Date:
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. +