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

From Igal @ Lucee.org
Subject [GENERAL] Migrating money column from MS SQL Server to Postgres
Date
Msg-id 8acca674-ac7c-2b48-9a3e-8b8acf8b2c36@lucee.org
Whole thread Raw
Responses Re: [GENERAL] Migrating money column from MS SQL Server to Postgres
Re: [GENERAL] Migrating money column from MS SQL Server to Postgres
List pgsql-general

Hello,

I am migrating a database from MS SQL Server to Postgres. 

I have a column named "discount" of type money in SQL Server.  I created the table in Postgres with the same name and type, since Postgres has a type named money, and am transferring the data by using PDI (Pentaho Data Integration) Kettle/Spoon.

Kettle throws an error though:  column "discount" is of type money but expression is of type double precision.

The value in the offending insert is:  0.0

Why does Postgres decide that 0.0 is "double precision" (which is a weird name in my opinion -- why can't it just be double) and not money?

I have control over the SELECT but not over the INSERT.  Is there any way to set the cast the value on the SELECT side in MS SQL Server to specify the column type of Postgres-money?

The only solution I found is to set the column in Postgres to DOUBLE PRECISION instead of MONEY, but I'm not sure if there are negative side effects to that?

Igal Sapir
Lucee Core Developer
Lucee.org

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: [GENERAL] database size changed after restoring using pg_restore
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] Migrating money column from MS SQL Server to Postgres