Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5KH0fa01370 for ; Wed, 20 Jun 2001 13:00:41 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5EGT7E77296 for ; Thu, 14 Jun 2001 12:29:07 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f5EG5JR58820 for pgsql-sql@postgresql.org; Thu, 14 Jun 2001 12:05:19 -0400 (EDT) (envelope-from news) From: "Alex K." X-Newsgroups: comp.databases.postgresql.sql Subject: casting varchar to numeric Date: Thu, 14 Jun 2001 09:09:02 -0700 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 16 Message-ID: <9ganbr$1pdt$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 To: pgsql-sql@postgresql.org X-Archive-Number: 200106/311 X-Sequence-Number: 3576 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.