Re: to_char PL/MI fix

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: to_char PL/MI fix
Date: 2003-03-20 15:45:54
Message-ID: 200303201545.h2KFjs128181@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Is the new output valid? If so I can easily at least fix those.

---------------------------------------------------------------------------

Karel Zak wrote:
> On Thu, Mar 20, 2003 at 01:17:22AM -0500, Bruce Momjian wrote:
> >
> > This patch caused the following regression failures. Is the new output
> > valid?
>
> Good point. I will prepare separate patch with tests and docs fix.
>
> Karel
>
> >
> > ---------------------------------------------------------------------------
> >
> > Karel Zak wrote:
> > >
> > >
> > > Peter found bug in the to_char() routine for PL/MI options. This
> > > patch fix it -- but this patch doesn't contains tests or docs fixes. I
> > > will send it later.
> > >
> > > Fixed outputs:
> > >
> > > select to_char(x, '9999.999') as x,
> > > to_char(x, 'S9999.999') as s,
> > > to_char(x, 'SG9999.999') as sg,
> > > to_char(x, 'MI9999.999') as mi,
> > > to_char(x, 'PL9999.999') as pl,
> > > to_char(x, 'PLMI9999.999') as plmi,
> > > to_char(x, '9999.999SG') as sg2,
> > > to_char(x, '9999.999PL') as pl2,
> > > to_char(x, '9999.999MI') as mi2 from num;
> > >
> > > x | s | sg | mi | pl |
> > > -----------+-----------+-----------+-----------+------------+
> > > 123.000 | +123.000 | + 123.000 | 123.000 | + 123.000 |
> > > -123.000 | -123.000 | - 123.000 | - 123.000 | -123.000 |
> > > -1231.000 | -1231.000 | -1231.000 | -1231.000 | -1231.000 |
> > > 1231.000 | +1231.000 | +1231.000 | 1231.000 | + 1231.000 |
> > > 1.900 | +1.900 | + 1.900 | 1.900 | + 1.900 |
> > > -1.900 | -1.900 | - 1.900 | - 1.900 | -1.900 |
> > > -.900 | -.900 | - .900 | - .900 | -.900 |
> > > .900 | +.900 | + .900 | .900 | + .900 |
> > > .945 | +.945 | + .945 | .945 | + .945 |
> > > -.945 | -.945 | - .945 | - .945 | -.945 |
> > > -150.945 | -150.945 | - 150.945 | - 150.945 | -150.945 |
> > > 150.945 | +150.945 | + 150.945 | 150.945 | + 150.945 |
> > >
> > > | plmi | sg2 | pl2 | mi2
> > > +------------+-----------+------------+-----------
> > > | + 123.000 | 123.000+ | 123.000+ | 123.000
> > > | - 123.000 | 123.000- | -123.000 | 123.000-
> > > | -1231.000 | 1231.000- | -1231.000 | 1231.000-
> > > | + 1231.000 | 1231.000+ | 1231.000+ | 1231.000
> > > | + 1.900 | 1.900+ | 1.900+ | 1.900
> > > | - 1.900 | 1.900- | -1.900 | 1.900-
> > > | - .900 | .900- | -.900 | .900-
> > > | + .900 | .900+ | .900+ | .900
> > > | + .945 | .945+ | .945+ | .945
> > > | - .945 | .945- | -.945 | .945-
> > > | - 150.945 | 150.945- | -150.945 | 150.945-
> > > | + 150.945 | 150.945+ | 150.945+ | 150.945
> > >
> > >
> > > Karel
> > >
> > >
> > > --
> > > Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
> > > http://home.zf.jcu.cz/~zakkr/
> >
> > [ Attachment, skipping... ]
> >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 5: Have you checked our extensive FAQ?
> > >
> > > http://www.postgresql.org/users-lounge/docs/faq.html
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> > *** ./expected/int8.out Fri Sep 20 12:44:55 2002
> > --- ./results/int8.out Thu Mar 20 01:11:21 2003
> > ***************
> > *** 155,161 ****
> >
> > SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
> > to_char_5 | to_char
> > ! -----------+--------------------
> > | 456
> > | 4567890123456789
> > | 123
> > --- 155,161 ----
> >
> > SELECT '' AS to_char_5, to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
> > to_char_5 | to_char
> > ! -----------+-------------------
> > | 456
> > | 4567890123456789
> > | 123
> > ***************
> > *** 175,181 ****
> >
> > SELECT '' AS to_char_7, to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
> > to_char_7 | to_char
> > ! -----------+--------------------
> > | 456TH
> > | 4567890123456789TH
> > | 123RD
> > --- 175,181 ----
> >
> > SELECT '' AS to_char_7, to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
> > to_char_7 | to_char
> > ! -----------+---------------------
> > | 456TH
> > | 4567890123456789TH
> > | 123RD
> >
> > ======================================================================
> >
> > *** ./expected/numeric.out Fri Sep 20 12:44:55 2002
> > --- ./results/numeric.out Thu Mar 20 01:11:45 2003
> > ***************
> > *** 762,768 ****
> >
> > SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
> > to_char_5 | to_char
> > ! -----------+------------------------------------
> > | .000000000000000
> > | .000000000000000
> > | - 34338492.215397047000000
> > --- 762,768 ----
> >
> > SELECT '' AS to_char_5, to_char(val, 'MI9999999999999999.999999999999999') FROM num_data;
> > to_char_5 | to_char
> > ! -----------+-----------------------------------
> > | .000000000000000
> > | .000000000000000
> > | - 34338492.215397047000000
> > ***************
> > *** 792,807 ****
> >
> > SELECT '' AS to_char_7, to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
> > to_char_7 | to_char
> > ! -----------+----------------------
> > ! | 0.
> > ! | 0.
> > | <34338492.215397047>
> > ! | 4.31
> > ! | 7799461.4119
> > ! | 16397.038491
> > ! | 93901.57763026
> > | <83028485.>
> > ! | 74881.
> > | <24926804.04504742>
> > (10 rows)
> >
> > --- 792,807 ----
> >
> > SELECT '' AS to_char_7, to_char(val, 'FM9999999999999999.999999999999999THPR') FROM num_data;
> > to_char_7 | to_char
> > ! -----------+-------------------------------------
> > ! | .000000000000000TH
> > ! | .000000000000000TH
> > | <34338492.215397047>
> > ! | 4.310000000000000TH
> > ! | 7799461.411900000000000TH
> > ! | 16397.038491000000000TH
> > ! | 93901.577630260000000TH
> > | <83028485.>
> > ! | 74881.000000000000000TH
> > | <24926804.04504742>
> > (10 rows)
> >
> > ***************
> > *** 958,965 ****
> > SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
> > to_char_18 | to_char
> > ------------+-----------------------------------------------------------------------
> > ! | . +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > ! | . +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > | -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
> > | +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > | +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
> > --- 958,965 ----
> > SELECT '' AS to_char_18, to_char(val, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9') FROM num_data;
> > to_char_18 | to_char
> > ------------+-----------------------------------------------------------------------
> > ! | +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > ! | +. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > | -3 4 3 3 8 4 9 2 . 2 1 5 3 9 7 0 4 7 0 0 0 0 0 0 0 0
> > | +4 . 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > | +7 7 9 9 4 6 1 . 4 1 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0
> >
> > ======================================================================
> >
>
>
> --
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
> http://home.zf.jcu.cz/~zakkr/
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Karel Zak 2003-03-20 17:08:30 Re: to_char PL/MI fix
Previous Message Bruce Momjian 2003-03-20 15:45:16 Re: psql patch (2)