Skip site navigation (1) Skip section navigation (2)

[TEST REPORT] 9.1Alpha3 Feature E.1.4.7.2 in release notes.

From: Ramanujam <innomotive(at)gmail(dot)com>
To: pgsql-testers(at)postgresql(dot)org
Subject: [TEST REPORT] 9.1Alpha3 Feature E.1.4.7.2 in release notes.
Date: 2011-01-07 05:10:54
Message-ID: AANLkTikg5S_ou3+N6abiwSGLfNxPDkmbsb1gYpMQcdBU@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-testers
[TEST REPORT]

[Release]: 9.1Alpha3. Binaries compiled with mingw-32 (gcc 4.4.0) on
i686 without zlib support.

[Test Type]: Feature

[Test]: a) Check feature E.1.4.7.2 in 9.1Alpha3 release notes
(Monetary data type). b) Documentation mistake(?)

[Platform]: Windows 7 Professional 64 bit. Intel Core i5 2.67 GHz. 4 GB RAM.

[Parameters]: None

[Failure]: Yes

[Results]: Documentation states that integer literals are allowed
values for input. I am getting the following error:

test=# select version();
PostgreSQL 9.1alpha3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
4.4.0, 32-bit
(1 row)

test=# show lc_monetary;
Japanese_Japan.932
(1 row)

test-# CREATE TABLE moneytbl VALUES (m1 money, m2 money);
CREATE TABLE
test=# INSERT INTO moneytbl VALUES (1,2);
ERROR: column "m1" is of type money but expression is of type integer
at character 30
HINT: You will need to rewrite or cast the expression.
STATEMENT: INSERT INTO moneytbl VALUES (1,2);
ERROR: column "m1" is of type money but expression is of type integer
LINE 1: INSERT INTO moneytbl VALUES (1,2);
                                                               ^
HINT: You will need to rewrite or cast the expression.
test-#

[Comments]:
1. Other type of inserts seem fine so far:
test=# INSERT INTO moneytbl VALUES ('1','2');
INSERT 0 1
test=# INSERT INTO moneytbl VALUES ('\1',\'2');   -- The "\" character
translates to the yen symbol in a Windows japanese locale environment.
INSERT 0 1
test=# INSERT INTO moneytbl VALUES (1::numeric,2::numeric); -- Feature
numeric to money cast check. OK.
INSERT 0 1
test=# INSERT INTO moneytbl VALUES (10.4345,7.234);
INSERT 0 1
test=# SELECT *, m1/m2 INTO moneytbl VALUES (10.4345,7.234); --
Feature division of monetary types yielding float8. OK.
 m1  | m2 |
-----+----+------------------
  \1 | \2 |              0.5
  \1 | \2 |              0.5
  \1 | \2 |              0.5
 \10 | \7 | 1.42857142857143

2. A nitpick is that fraction yen values cannot be saved. float8
inputs in ja_JP locale settings get rounded (as seen above). While the
lowest denomination is indeed 1円, fractional yen values are highly
desirable. I am forced to use numeric (x,2) as fractional yen values
are not supported. This is based on a production use-case scenario.

Responses

pgsql-hackers by date

Next:From: RamanujamDate: 2011-01-07 05:12:58
Subject: Re: [TEST REPORT] 9.1Alpha3 Feature E.1.4.7.2 in release notes.
Previous:From: Greg SmithDate: 2011-01-07 04:33:23
Subject: Re: We need to log aborted autovacuums

pgsql-testers by date

Next:From: RamanujamDate: 2011-01-07 05:12:58
Subject: Re: [TEST REPORT] 9.1Alpha3 Feature E.1.4.7.2 in release notes.
Previous:From: Guillaume LelargeDate: 2010-10-15 22:24:54
Subject: Re: two questions about pg 9.0

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group