automatic type cast to numeric ?

From: Peter Vazsonyi <neko(at)sun2(dot)szif(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: automatic type cast to numeric ?
Date: 2001-02-03 22:40:32
Message-ID: Pine.LNX.4.10.10102032304410.14614-100000@sun2.szif.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Roderick A. Anderson 2001-02-04 00:48:12 RE: GIS-type databases using PostgreSQL
Previous Message Tom Lane 2001-02-03 21:20:56 Re: Postgres SQL 7.1 a thank you and a possible bug