numeric type conversions

From: Ruslan A Dautkhanov <rusland(at)scn(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: numeric type conversions
Date: 2002-09-24 04:39:08
Message-ID: 3D8FEC6C.74A034C4@scn.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I should cast field of 'text' type to the 'numeric' type,
but PG output error message: "ERROR: Cannot cast type 'text' to
'numeric'".
I had tried to use conversion to type 'float' and all works good,
and now I must write quaries like next one:
SELECT price::float::numeric .... FROM priceValues WHERE ...

Why confusion situation between types numeric, float and text ?
There are any reasons to not to write default type conversion
from 'text' to 'numeric' in the PostgreSQL 7.3?

Imho, almost all types should have default convertors from and to
the 'text' (varchar etc) type..

Thanks,
Ruslan A Dautkhanov

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message fredrik chabot 2002-09-24 07:58:42 Re: some other backend died abnormally
Previous Message Tom Lane 2002-09-23 16:33:50 Re: Bug #779: query 'SELECT '{1,2}' *= NULL' crash backend