Search Postgresql Archives

Migrating money column from MS SQL Server to Postgres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux