Re: Cast char to number - Mailing list pgsql-general

From Bill Moran
Subject Re: Cast char to number
Date
Msg-id 20100224143847.604d7ef2.wmoran@potentialtech.com
Whole thread Raw
In response to Cast char to number  (Christine Penner <christine@ingenioussoftware.com>)
Responses Re: Cast char to number  (Christine Penner <christine@ingenioussoftware.com>)
List pgsql-general
In response to Christine Penner <christine@ingenioussoftware.com>:

> I have a character field I want to change to a number. The values in
> that field are all numbers that may or may not be padded with spaces
> or 0's. What is the best way to do that?

Put the values in numeric fields to begin with and cast to chars as
needed.  Basically reverse what you're doing.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

pgsql-general by date:

Previous
From: Christine Penner
Date:
Subject: Cast char to number
Next
From: Christine Penner
Date:
Subject: Re: Cast char to number