Thread: double precision vs. numeric

double precision vs. numeric

From
Aarni Ruuhimäki
Date:
Hello,

Not sure if this is the right list to ask ...

I vaguely remember having seen a message

' ... type double precision ... will be depreciated / unsupported in future
releases ... '

or something like that somewhere. (?)

I have quite a few older dbs with tables that have one or more fields type
double precision and have so far upgraded ok since 7.0.x (I now use numeric
with appropriate precision and scale.)

Is there something to worry about when upgrading next time ? Start changing
these to numeric perhaps ?

Running 8.0.2 at the moment.

Best regards to all,

Aarni
--
Aarni Ruuhimäki

**Kmail**
**Fedora Core Linux**


Re: double precision vs. numeric

From
Peter Eisentraut
Date:
Aarni Ruuhimäki wrote:
> ' ... type double precision ... will be depreciated / unsupported in
> future releases ... '

That is completely false.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: double precision vs. numeric

From
Michael Fuhr
Date:
On Thu, Aug 24, 2006 at 06:51:33PM +0200, Peter Eisentraut wrote:
> Aarni Ruuhimäki wrote:
> > ' ... type double precision ... will be depreciated / unsupported in
> > future releases ... '
> 
> That is completely false.

Presumably because double precision is standard SQL and has been
so for a long time.  Perhaps Aarni is thinking about the money type,
which the documentation does say is deprecated.

-- 
Michael Fuhr


Re: double precision vs. numeric

From
Tom Lane
Date:
Aarni Ruuhimäki <aarni@kymi.com> writes:
> I vaguely remember having seen a message 
> ' ... type double precision ... will be depreciated / unsupported in future 
> releases ... '
> or something like that somewhere. (?)

Perhaps you are thinking of type "money"?  DOUBLE PRECISION is in the
SQL standard, it's certainly not going anywhere.
        regards, tom lane


Re: double precision vs. numeric

From
Aarni Ruuhimäki
Date:
On Thursday 24 August 2006 20:29, Tom Lane wrote:
> Aarni Ruuhimäki <aarni@kymi.com> writes:
> > I vaguely remember having seen a message
> > ' ... type double precision ... will be depreciated / unsupported in
> > future releases ... '
> > or something like that somewhere. (?)
>
> Perhaps you are thinking of type "money"?  DOUBLE PRECISION is in the
> SQL standard, it's certainly not going anywhere.
>
>    regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

Well, I have used it for 'money type' like sums and prices but I have never
used the actual "money" data type.

So, false alarm.

Thank you guys !

Aarni
--
Aarni Ruuhimäki

**Kmail**
**Fedora Core Linux**



Re: double precision vs. numeric

From
Aarni Ruuhimäki
Date:
On Friday 25 August 2006 08:12, Aarni Ruuhimäki wrote:
> On Thursday 24 August 2006 20:29, Tom Lane wrote:
> > Aarni Ruuhimäki <aarni@kymi.com> writes:
> > > I vaguely remember having seen a message
> > > ' ... type double precision ... will be depreciated / unsupported in
> > > future releases ... '
> > > or something like that somewhere. (?)
> >
> > Perhaps you are thinking of type "money"?  DOUBLE PRECISION is in the
> > SQL standard, it's certainly not going anywhere.
> >
> >    regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below 8.0, the planner will ignore your desire to
> >        choose an index scan if your joining column's datatypes do not
> >        match
>
> Well, I have used it for 'money type' like sums and prices but I have never
> used the actual "money" data type.
>
> So, false alarm.
>
> Thank you guys !
>
> Aarni

Hi,

Now I saw it again. In a terminal window after an insert from an application:

WARNING:  deprecated input syntax for type double precision: ""
DETAIL:  This input will be rejected in a future release of PostgreSQL.

So this merely means that in future one can not insert empty values into field
of type double precision ?

BR,

Aarni

--
Aarni Ruuhimäki

**Kmail**
**Fedora Core Linux**



Re: double precision vs. numeric

From
Michael Fuhr
Date:
On Mon, Aug 28, 2006 at 11:08:50AM +0300, Aarni Ruuhimki wrote:
> Now I saw it again. In a terminal window after an insert from an application:
> 
> WARNING:  deprecated input syntax for type double precision: ""
> DETAIL:  This input will be rejected in a future release of PostgreSQL.
> 
> So this merely means that in future one can not insert empty values into field 
> of type double precision ? 

Right.  8.0 issues a warning and 8.1 gives an error:

8.0.8
test=> SELECT ''::double precision;
WARNING:  deprecated input syntax for type double precision: ""
DETAIL:  This input will be rejected in a future release of PostgreSQL.float8 
--------     0
(1 row)

8.1.4
test=> SELECT ''::double precision;
ERROR:  invalid input syntax for type double precision: ""

-- 
Michael Fuhr


Re: double precision vs. numeric

From
Aarni Ruuhimäki
Date:
On Monday 28 August 2006 16:08, you wrote:
> > So this merely means that in future one can not insert empty values into
> > field of type double precision ?
>
> Right.  8.0 issues a warning and 8.1 gives an error:
>

Ok, thanks.

But NULLs will go in the future too ?

BR,

Aarni

--
Aarni Ruuhimäki

**Kmail**
**Fedora Core Linux**


Re: double precision vs. numeric

From
Michael Fuhr
Date:
On Mon, Aug 28, 2006 at 04:32:31PM +0300, Aarni Ruuhimki wrote:
> On Monday 28 August 2006 16:08, you wrote:
> > > So this merely means that in future one can not insert empty values into
> > > field of type double precision ?
> >
> > Right.  8.0 issues a warning and 8.1 gives an error:
> 
> Ok, thanks.
> 
> But NULLs will go in the future too ?

Only if Chris Date takes over the project ;-)

-- 
Michael Fuhr


Re: double precision vs. numeric

From
"D'Arcy J.M. Cain"
Date:
On Mon, 28 Aug 2006 16:32:31 +0300
Aarni Ruuhimäki <aarni@kymi.com> wrote:
> > > So this merely means that in future one can not insert empty values into
> > > field of type double precision ?
> >
> > Right.  8.0 issues a warning and 8.1 gives an error:
>
> But NULLs will go in the future too ?

No, NULL has always been the correct way to insert a non-value into a
field.  Text/char type fields are the only ones where an empty string
is a valid value.

--
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.