Re[2]: [GENERAL] Dividing Money

Поиск
Список
Период
Сортировка
От Sferacarta Software
Тема Re[2]: [GENERAL] Dividing Money
Дата
Msg-id 13563.981202@bo.nettuno.it
обсуждение исходный текст
Ответ на Re: [GENERAL] Dividing Money  (tolik@icomm.ru (Anatoly K. Lasareff))
Список pgsql-general
Hello Anatoly,

mercoledì, 2 dicembre 98, you wrote:

>>>>>> "BD" == Bob Dusek <bobd@palaver.net> writes:

AKL>  BD> When I query my database, using 'select price from item_money;', postgres
AKL>  BD> returns just what I asked for....

AKL>  BD> (the first seven rows)

AKL>  BD> price
AKL>  BD> -------
AKL>  BD> $4.45
AKL>  BD> $2.95
AKL>  BD> $4.45
AKL>  BD> $2.95
AKL>  BD> $3.95
AKL>  BD> $3.95
AKL>  BD> $3.95

AKL>  BD> When I query my database using the query 'select price::float as price
AKL>  BD> from item_money', I get back some wierd stuff....

AKL>  BD> (the first seven rows)

AKL>  BD> price
AKL>  BD> ----------
AKL>  BD> 1080319164
AKL>  BD> 1080319108
AKL>  BD> 1080319052
AKL>  BD> 1080318996
AKL>  BD> 1080318940
AKL>  BD> 1080318884
AKL>  BD> 1080318828

AKL>  BD> In my first query results, the first row is the same as the third row.
AKL>  BD> And, the second row is the same as the fourth row.  And, rows 5,6,7 are
AKL>  BD> all the same.  However, in the results returned from my second query,
AKL>  BD> there are not any rows of equal value.... ???

I don't know your PostgreSQL version but I suppose you have 6.3.2 or
lower.
There was a problem to cast money to float on such versions.
v6.4 doesn't allow this kind of cast.

prova=> select sal::float from emp;
ERROR:  No such function 'float8' with the specified attributes
prova=> select sal::float from emp;

-Jose'-



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

Предыдущее
От: tolik@icomm.ru (Anatoly K. Lasareff)
Дата:
Сообщение: Re: [GENERAL] Dividing Money
Следующее
От: teresa@pisa.intecs.it (Maria Teresa Faga)
Дата:
Сообщение: Text field.