[GENERAL] Migrating money column from MS SQL Server to Postgres

Поиск
Список
Период
Сортировка
От Igal @ Lucee.org
Тема [GENERAL] Migrating money column from MS SQL Server to Postgres
Дата
Msg-id 8acca674-ac7c-2b48-9a3e-8b8acf8b2c36@lucee.org
обсуждение исходный текст
Ответы Re: [GENERAL] Migrating money column from MS SQL Server to Postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [GENERAL] Migrating money column from MS SQL Server to Postgres  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: [GENERAL] database size changed after restoring using pg_restore
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Migrating money column from MS SQL Server to Postgres