pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Oracle number to PostgreSQL
3+ messages / 2 participants
[nested] [flat]

* Oracle number to PostgreSQL
@ 2019-05-01 13:01  Charlin Barak <charlinbarak@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Charlin Barak @ 2019-05-01 13:01 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,
When migrating from Oracle number(10,3) to PostgreSQL, is numeric(10,3)
ideal or should I consider some other data types?

Thanks.

Charlin

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Oracle number to PostgreSQL
@ 2019-05-01 13:25  Stephen Frost <sfrost@snowman.net>
  parent: Charlin Barak <charlinbarak@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Stephen Frost @ 2019-05-01 13:25 UTC (permalink / raw)
  To: Charlin Barak <charlinbarak@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

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

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Oracle number to PostgreSQL
@ 2019-05-01 14:31  Charlin Barak <charlinbarak@gmail.com>
  parent: Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Charlin Barak @ 2019-05-01 14:31 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-general@lists.postgresql.org

Thanks Stephen. Something for me to consider.

Charlin

On Wed, May 1, 2019 at 9:25 AM Stephen Frost <sfrost@snowman.net> wrote:

> 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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-05-01 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 13:01 Oracle number to PostgreSQL Charlin Barak <charlinbarak@gmail.com>
2019-05-01 13:25 ` Stephen Frost <sfrost@snowman.net>
2019-05-01 14:31   ` Charlin Barak <charlinbarak@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox