Re: Data types - Mailing list pgsql-general

From Mitch Vincent
Subject Re: Data types
Date
Msg-id 010601c12a89$1125a350$1251000a@mitch
Whole thread Raw
In response to Data types  ("Mihai Gheorghiu" <tanethq@earthlink.net>)
List pgsql-general
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
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: macaddr data type issue
Next
From: Tom Lane
Date:
Subject: Re: Postgres hangs during VACUUM (autocommit = false)