money data type and conversions

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема money data type and conversions
Дата
Msg-id 199906221740.NAA21057@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: [HACKERS] money data type and conversions  (Duane Currie <dcurrie@sandman.acadiau.ca>)
RE: [HACKERS] money data type and conversions  (Vince Vielhaber <vev@michvhf.com>)
Re: [HACKERS] money data type and conversions  ("D'Arcy" "J.M." Cain <darcy@druid.net>)
Список pgsql-hackers
Can someone explain why our money type in 6.5 requires quotes, and why
there is no int() function for it?

---------------------------------------------------------------------------


test=> create table t(x money);
CREATE
test=> insert into t values (3.3);
ERROR:  Attribute 'x' is of type 'money' but expression is of type 'float8'       You will need to rewrite or cast the
expression
test=> insert into t values (3.33);
ERROR:  Attribute 'x' is of type 'money' but expression is of type 'float8'       You will need to rewrite or cast the
expression
test=> insert into t values (money(3.33));
ERROR:  No such function 'money' with the specified attributes
test=> insert into t values (cash(3.33));
ERROR:  No such function 'cash' with the specified attributes
test=> insert into t values (3.33);
ERROR:  Attribute 'x' is of type 'money' but expression is of type 'float8'       You will need to rewrite or cast the
expression
test=> insert into t values ('3.33');
INSERT 18569 1
test=> select int(x) from t;
ERROR:  No such function 'int' with the specified attributes
test=> select int4(x) from t;
ERROR:  No such function 'int4' with the specified attributes

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] has anybody else used r-tree indexes in 6.5?
Следующее
От: "Deva Vejay"
Дата:
Сообщение: PostgreSql HELP!