Thread: Data types

Data types

From
"Mihai Gheorghiu"
Date:
Would Java BigDecimal type be a good match for PG Numeric, or do I need to
look further?

Thank you all,

Mihai Gheorghiu


Re: Data types

From
"Mitch Vincent"
Date:
Numeric is just a fixed-precision type, it can handle any number (I guess?)
as long as your realize it will round the number to the precision that it
was originally set up to keep.. For instance :

brw=# create table test (test numeric(9,2));
CREATE
brw=# insert into test values (9.12345);
INSERT 2503213 1
brw=# select * from test;
 test
------
 9.12
(1 row)

brw=# insert into test values (9.149);
INSERT 2503214 1

brw=# select * from test;
 test
------
 9.12
 9.15
(2 rows)

So just about any type is an OK match, as long as the above behavior is
realized and expected.

Good luck!

-Mitch


----- Original Message -----
From: "Mihai Gheorghiu" <tanethq@earthlink.net>
To: <pgsql-general@postgresql.org>
Sent: Tuesday, August 21, 2001 4:12 PM
Subject: [GENERAL] Data types


> Would Java BigDecimal type be a good match for PG Numeric, or do I need to
> look further?
>
> Thank you all,
>
> Mihai Gheorghiu
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>


Re: Data types

From
Barry Lind
Date:
FYI -- jdbc questions should go to the pgsql-jdbc mail list.

To your question, yes BigDecimal it the appropriate java data type for a
  postgres numeric data type.

thanks,
--Barry

Mihai Gheorghiu wrote:
> Would Java BigDecimal type be a good match for PG Numeric, or do I need to
> look further?
>
> Thank you all,
>
> Mihai Gheorghiu
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>