Re: Data types

From: "Mitch Vincent" <mvincent(at)cablespeed(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Data types
Date: 2001-08-21 21:34:32
Message-ID: 010601c12a89$1125a350$1251000a@mitch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

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(at)earthlink(dot)net>
To: <pgsql-general(at)postgresql(dot)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
>

In response to

  • Data types at 2001-08-21 20:12:51 from Mihai Gheorghiu

Browse pgsql-general by date

  From Date Subject
Next Message Mike Finn 2001-08-21 21:41:22 Comparing fixed precision to floating
Previous Message Tom Lane 2001-08-21 21:26:58 Re: macaddr data type issue

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ned Wolpert 2001-08-21 21:37:05 Re: JDBC changes for 7.2... some questions...
Previous Message Tom Lane 2001-08-21 21:31:55 Re: JDBC changes for 7.2... some questions...