Typcasting - Mailing list pgsql-general

From Chris Boget
Subject Typcasting
Date
Msg-id 015001c2b5a2$470ed900$8c01a8c0@ENTROPY
Whole thread Raw
In response to How to Implement Versioned Rows in PostgreSQL?  (Alan Gutierrez <ajglist@izzy.net>)
Responses Re: Typcasting
List 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to Implement Versioned Rows in PostgreSQL?
Next
From: Richard Huxton
Date:
Subject: Re: How to insert into another db instance in pl/plsql...