Re: [GENERAL] Migrating money column from MS SQL Server to Postgres - Mailing list pgsql-general

From Igal @ Lucee.org
Subject Re: [GENERAL] Migrating money column from MS SQL Server to Postgres
Date
Msg-id 724bab58-87d9-7b02-867b-5d98b93aac7d@lucee.org
Whole thread Raw
In response to Re: [GENERAL] Migrating money column from MS SQL Server to Postgres  ("Igal @ Lucee.org" <igal@lucee.org>)
Responses Re: [GENERAL] Migrating money column from MS SQL Server to Postgres  (Allan Kamau <kamauallan@gmail.com>)
List pgsql-general
On 11/8/2017 6:25 PM, Igal @ Lucee.org wrote:
> On 11/8/2017 5:27 PM, Allan Kamau wrote:
>> Maybe using NUMERIC without explicitly stating the precision is 
>> recommended. This would allow for values with many decimal places to 
>> be accepted without truncation. Your field may need to capture very 
>> small values such as those in bitcoin trading or some banking fee or 
>> interest.
>
> That's a very good idea.  For some reason I thought that I tried that 
> earlier and it didn't work as expected, but I just tested it (again?) 
> and it seems to work well, so that's what I'll do.

Another weird thing that I noticed:

On another column, "total_charged", that was migrated properly as a 
`money` type, when I run `sum(total_charged::money)` I get `null`, but 
if I cast it to numeric, i.e. `sum(total_charged::numeric)`, I get the 
expected sum result.

Is there a logical explanation to that?


Igal


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: "Igal @ Lucee.org"
Date:
Subject: Re: [GENERAL] Migrating money column from MS SQL Server to Postgres
Next
From: Mayank Agrawal
Date:
Subject: [GENERAL] PostgreSQL 9.5 showing unexpected behavior when installed withdifferent locale other than default