Re: Cast char to number

From: Christine Penner <christine(at)ingenioussoftware(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>, Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cast char to number
Date: 2010-02-24 19:53:42
Message-ID: 19740415002336.059780E0638F2E28@edtnaa02.telusplanet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't understand what you mean. This is a column in a table that is
already a char and has numbers in it. I want it to be a number field
not character. How can I change the data type of that column without
loosing the data I have in it?

Christine

At 11:38 AM 24/02/2010, you wrote:
>In response to Christine Penner <christine(at)ingenioussoftware(dot)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/
>
>--
>Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-02-24 20:06:50 Re: Cast char to number
Previous Message Bill Moran 2010-02-24 19:38:47 Re: Cast char to number