to_char PL/MI fix

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: to_char PL/MI fix
Date: 2003-02-24 16:40:34
Message-ID: 20030224164034.GA26629@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

Attachment Content-Type Size
formatting-02242003.patch.gz application/x-gzip 1.4 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Jeroen T. Vermeulen 2003-02-24 17:25:52 Re: psql patch
Previous Message Nigel J. Andrews 2003-02-24 14:32:47 Re: psql patch