Re: Converting VARCHAR to DECIMAL or NUMERIC - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: Converting VARCHAR to DECIMAL or NUMERIC
Date
Msg-id 20030825225737.L16064-100000@megazone.bigpanda.com
Whole thread Raw
In response to Converting VARCHAR to DECIMAL or NUMERIC  (Juan Francisco Diaz <j-diaz@publicar.com>)
List pgsql-novice
On Mon, 25 Aug 2003, Juan Francisco Diaz wrote:

> The subject says it all... How can that be done? I tried to do an explicit
> cast but... Id dint work.

I think currently you'll need to convert to text first, so something like:
cast(cast(varcharcol as text) as numeric) because there's no
varchar->numeric direct cast (although I'm not sure if an explicit cast
would be bad for those cases that text has currently that varchar doesn't)



pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: INSERT INTO foo (col1,col2,...,coln) not working
Next
From: Juan Francisco Diaz
Date:
Subject: How come PGsql function can only handle 3 params?