Re: Oracle number to PostgreSQL

From: Charlin Barak <charlinbarak(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Oracle number to PostgreSQL
Date: 2019-05-01 14:31:58
Message-ID: CAPrg5cZ2f6tMu2quhNoZWLk9vdYqzZdDFmjcuYDvwRRFXc+o+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Stephen. Something for me to consider.

Charlin

On Wed, May 1, 2019 at 9:25 AM Stephen Frost <sfrost(at)snowman(dot)net> wrote:

> Greetings,
>
> * Charlin Barak (charlinbarak(at)gmail(dot)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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chuck Martin 2019-05-01 16:26:47 Query not producing expected result
Previous Message Stephen Frost 2019-05-01 13:25:18 Re: Oracle number to PostgreSQL