casting varchar to numeric

From: "Alex K(dot)" <alex(at)freeview(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: casting varchar to numeric
Date: 2001-06-14 16:09:02
Message-ID: 9ganbr$1pdt$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there any way to cast a varchar value to numeric?

I just found out that neither an implicit nor an explicit cast is permitted
when trying to convert from varchar to numeric, but I need to move the
values from that varchar field (which are all numeric characters, by the
way) into a numeric field. I'd prefer doing this inside Postgres, as
opposed to scripting it using PERL or something...

Thanks for any helpful advice (helpful advice does NOT include 'You should
have just created a numeric field in the first place').

=)

Alex K.

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-06-14 16:15:04 Re: Re: Timestamp without time zone
Previous Message Tom Lane 2001-06-14 15:51:35 Re: performance issues