Re: What do you think? - Mailing list pgsql-general

From Ross J. Reedstrom
Subject Re: What do you think?
Date
Msg-id 20000505141000.B5035@rice.edu
Whole thread Raw
In response to Re: What do you think?  (Jurgen Defurne <defurnj@glo.be>)
List pgsql-general
On Fri, May 05, 2000 at 07:33:51PM +0200, Jurgen Defurne wrote:
> Ross J. Reedstrom wrote:
>
> >
> > Good news, Jurgen! NUMERIC has been in there since 6.5.0, (hmm, can't
> > find a release date. Should ask Bruce to put a timeline somewhere)
> > There're a few bug fixes/feature extensions for it in 7.0 (to be released
> > Monday), some things like indices, arrays, log() and casting to numeric,
> > but otherwise, I think it's been a pretty stable basic type since it's
> > release. What version of PostgreSQL are you basing your comments on? You
> > sound fairly positive, even if you're using an older version.  It's gotten
> > better! One of the curses of Open Source is how fast it can develop:
> > 6.5 was a huge leap over 6.4, and 7.0 is at least as big a jump past 6.5.
> >
> > Ross
> > --
> > Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
> > NSBRI Research Scientist/Programmer
> > Computer and Information Technology Institute
> > Rice University, 6100 S. Main St.,  Houston, TX 77005
>
> I am using probably 6.5.2 on my server, and absolutely 6.5.3 on my laptop for
> development. From the documentation I know that there are numeric types,
> but these are all binary integer types, as supplied with C -> 2, 4 and 8 byte
> types.
>
> I do not find any reference to a numeric type which can be defined as having
> D digits and P precision, like this : NUMERIC(D, P).
> Example : NUMERIC(8, 4) is a number with this format 9999.9999, etc.
>
> Jurgen
>
>

Jurgen - I'm not lying to you, there'd be no point. The second
curse of Open Source software is that documentation always lags
implementation. Just try it! Here's a transcript from a session with
6.5.0:


wallace$ psql
Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.0 on i686-pc-linux-gnu, compiled by gcc 2.7.2.3]

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: reedstrm

reedstrm=>create table test (n numeric(10,2), t text);
CREATE
reedstrm=> \d test
Table    = test
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| n                                | numeric                          | 10.2  |
| t                                | text                             |   var |
+----------------------------------+----------------------------------+-------+
reedstrm=> insert into test values (12345678.90,'some number');
INSERT 1030922 1
reedstrm=> insert into test values (12345678.90234,'some other number');
INSERT 1030923 1
reedstrm=> insert into test values (123456780.90234,'too big a  number');
ERROR:  overflow on numeric ABS(value) >= 10^8 for field with precision 10 scale 2
reedstrm=> select * from test;
          n|t
-----------+-----------------
12345678.90|some number
12345678.90|some other number
(2 rows)

reedstrm=>

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

pgsql-general by date:

Previous
From: "Donald Dade"
Date:
Subject: Re: ../\...Advice For New Immigrants^^^..
Next
From: Paulo Henrique Rodrigues Pinheiro
Date:
Subject: Re: ../\...Advice For New Immigrants^^^..