integer instead of 'double precision'? - Mailing list pgsql-general

From Henry Drexler
Subject integer instead of 'double precision'?
Date
Msg-id CAAtgU9QHTCei4Z3N2QTdfokdON50=yWkK4iTUQTicxgFY9-inQ@mail.gmail.com
Whole thread Raw
Responses Re: integer instead of 'double precision'?  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: integer instead of 'double precision'?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: integer instead of 'double precision'?  (Scott Ribe <scott_ribe@elevated-dev.com>)
List pgsql-general
take any table and run

Query
---------------------
select
1/3
from
storage
limit 1


Result
---------------------
?column?
integer
0


Expected Result
---------------------
?column?
double precision
0.33333...



Question
---------------------
Since there is no column type to begin with as this is a made-up column, shouldn't postgres know it is double precision due to the remainder?

I thought perhaps I could cast it as double precision as noted on http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html

though doing the following:

select
float8(1/3)
from
storage
limit 1

results in:

float8
double precision
0


any ideas on how to get this type of a manufactured column (not sure the right term for it) to show the double precision result?

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: PSQLRestore
Next
From: Guillaume Lelarge
Date:
Subject: Re: integer instead of 'double precision'?