Re: [GENERAL] Dividing Money - Mailing list pgsql-general

From tolik@icomm.ru (Anatoly K. Lasareff)
Subject Re: [GENERAL] Dividing Money
Date
Msg-id x7n257atzk.fsf@tolikus.hq.aaanet.ru
Whole thread Raw
In response to Dividing Money  (Bob Dusek <bobd@palaver.net>)
List pgsql-general
>>>>> "BD" == Bob Dusek <bobd@palaver.net> writes:

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

 BD> (the first seven rows)

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

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

 BD> (the first seven rows)

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

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

Pehaps these are _different_ sets of records? Try

select oid, price from ....

   and

select oid, price::float ....

oid is unique identifyer of row. Try also use explicit order of
records, '... order by price' or by any othe field.

--
Anatoly K. Lasareff              Email:       tolik@icomm.ru
Senior programmer

pgsql-general by date:

Previous
From: ZioBudda
Date:
Subject: insert or delete
Next
From: Sferacarta Software
Date:
Subject: Re[2]: [GENERAL] Dividing Money