Typcasting

From: "Chris Boget" <chris(at)wild(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Typcasting
Date: 2003-01-06 16:40:09
Message-ID: 015001c2b5a2$470ed900$8c01a8c0@ENTROPY
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a field in my table that is of type varchar. I'm trying
to do a bit of tidying up and since that field contains only
number, I want to convert the field to an integer type. So I
create a new table and modify/remove the fields as necessary
and then move the relevant data over to the new table. But
when I try to insert the field that I modified from varchar to
integer, I get an error because the type of data doesn't match
up. I'm told that I need to cast the value manually.
I've looked up the CAST function and tried everything that I
could think of but nothing seems to work. I can't, for the life
of me, move the data over.
I can I cast a field value? Is there any other way to do what
I'm trying to do?

Chris

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-01-06 16:58:39 Re: How to insert into another db instance in pl/plsql...
Previous Message Tom Lane 2003-01-06 16:24:48 Re: How to Implement Versioned Rows in PostgreSQL?