to_char PL/MI fix - Mailing list pgsql-patches

From Karel Zak
Subject to_char PL/MI fix
Date
Msg-id 20030224164034.GA26629@zf.jcu.cz
Whole thread Raw
Responses Re: to_char PL/MI fix
Re: to_char PL/MI fix
Re: to_char PL/MI fix
Re: to_char PL/MI fix
List pgsql-patches

 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@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

Attachment

pgsql-patches by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: psql patch
Next
From: Tom Lane
Date:
Subject: Re: psql patch