automatic type cast to numeric ? - Mailing list pgsql-general

From Peter Vazsonyi
Subject automatic type cast to numeric ?
Date
Msg-id Pine.LNX.4.10.10102032304410.14614-100000@sun2.szif.hu
Whole thread Raw
List pgsql-general
Gretings!

I try to change from using of float8 to numeric... For quantitative
calculations and storage the float8 wasn't the best choice;)
For some reasons i need automatic or explicit type cast from text to
numeric and vice versa.
But:
test=# select '123'::text::numeric;
ERROR:  Cannot cast type 'text' to 'numeric'
;(
test=# CREATE FUNCTION numeric(text) as 'SELECT float8($1)::numeric;'
LANGUAGE 'SQL';
ERROR:  parser: parse error at or near "numeric"
;(((
The another side (numeric to text) works...

I had some more clumsy shots with the type '_numeric', but i don't now
enough about the working of parametric types...

So i need Help;)

--
 thanx
 nek.

i use 7.0.2/7.0.3 i386.rpm-s


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres SQL 7.1 a thank you and a possible bug
Next
From: "Roderick A. Anderson"
Date:
Subject: RE: GIS-type databases using PostgreSQL