On Mon, 11 May 1998, Thomas G. Lockhart wrote:
> > I think that PostgreSQL money type should be very useful if we could
> > remove the dollar sign. We can't use it with Lira/Peseta/Mark etc.
> > In europe now we have Euro. If we remove the $ it will be useful
> > otherwise we have to rename it to 'dollar'. ;-)
>
> Have you tried compiling with "USE_LOCALE" turned on and with the right
> setting for LC_xxx? The code is supposed to use local conventions, but I
> don't know if it works in the way you want. I agree that it should...
>
> > PS: Is there a reason to left justify it ?
>
> That is just an artifact of the column formatting; all columns are left
> justified in psql afaik.
>
Seems there's some problems with type 'money'... I can't multiply or
divide 'money' types, and can't cast it properly to other data types.
prova=> select ename,job,hiredate, sal from employees;
ename |job | hiredate|sal
------+----------+----------+---------
ALLEN |SALESMAN |1981-02-20|$1,600.00
BLAKE |MANAGER |1981-05-01|$2,850.00
JONES |CLERK |1981-12-03|$950.00
MILLER|SALESMAN |1981-09-28|$1,250.00
CLARK |SALESMAN |1981-09-08|$1,500.00
KING |SALESMAN |1981-02-22|$1,250.00
(6 rows)
prova=> select ename,job,hiredate, sal*1.1 as dream from employees;
ERROR: There is no operator '*' for types 'money' and 'money'
You will either have to retype this query using an explicit cast,
or you will have to define the operator using CREATE OPERATOR
prova=> select ename,job,hiredate,sal, sal::float as dream from employees;
ename |job | hiredate|sal | dream
------+----------+----------+---------+----------
ALLEN |SALESMAN |1981-02-20|$1,600.00|1079143604
BLAKE |MANAGER |1981-05-01|$2,850.00|1079143508
JONES |CLERK |1981-12-03|$950.00 |1079143412
MILLER|SALESMAN |1981-09-28|$1,250.00|1079143316
CLARK |SALESMAN |1981-09-08|$1,500.00|1079143220
KING |SALESMAN |1981-02-22|$1,250.00|1079143120
(6 rows)
Is this a bug ?
Jose'