Re: Oracle number to PostgreSQL

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Oracle number to PostgreSQL
Дата
Msg-id 20190501132518.GC6197@tamriel.snowman.net
обсуждение исходный текст
Ответ на Oracle number to PostgreSQL  (Charlin Barak <charlinbarak@gmail.com>)
Ответы Re: Oracle number to PostgreSQL  (Charlin Barak <charlinbarak@gmail.com>)
Список pgsql-general
Greetings,

* Charlin Barak (charlinbarak@gmail.com) wrote:
> When migrating from Oracle number(10,3) to PostgreSQL, is numeric(10,3)
> ideal or should I consider some other data types?

This really depends on what data is actually in that field and if you
need it to be exact.

If the field actually contains integers and always will, then using an
integer type field is *much* more efficient, either 'integer' if the
values will always be less than 2B, or 'bigint' if it'll be larger.

If the field actually contains floating point and can be inexact, then
using 'real' or 'float8' will be more efficient than numeric.

If the field needs to be exact (eg: monetary fields), then using
numeric(10,3) is correct.

I strongly recommend considering the data that goes into the field when
making this decision- there really is no 'one size fits all' when going
from number to numeric.

Thanks,

Stephen

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Charlin Barak
Дата:
Сообщение: Oracle number to PostgreSQL
Следующее
От: Charlin Barak
Дата:
Сообщение: Re: Oracle number to PostgreSQL