Re: Making cstring type less pseudo and more real - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making cstring type less pseudo and more real
Date
Msg-id 1469.1030053900@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making cstring type less pseudo and more real  (Alvaro Herrera <alvherre@atentus.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@atentus.com> writes:
> alvh=> CREATE TABLE money_test (a money);
> CREATE TABLE
> alvh=> INSERT INTO money_test VALUES (2);
> ERROR:  column "a" is of type 'money' but expression is of type 'integer'
>     You will need to rewrite or cast the expression
> alvh=> INSERT INTO money_test VALUES ('2');
> ERROR:  Bad money external representation 2
> alvh=> INSERT INTO money_test VALUES ('2.00');
> ERROR:  Bad money external representation 2.00
> alvh=> INSERT INTO money_test VALUES ('$2.00');
> ERROR:  Bad money external representation $2.00
> alvh=> INSERT INTO money_test VALUES ('2'::money);
> ERROR:  Bad money external representation 2

What does "show lc_monetary" say?  I think you may be in a non-US locale.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CVS broken - large file support?
Next
From: Bruce Momjian
Date:
Subject: My head is spinning