[postgis-users] changin data type

Marcel Júlio marcelm at brturbo.com
Wed Nov 19 06:10:51 PST 2003


I'm trying to change the geocode column data type of my geometry table from
varchar to integer to improve the performance. Anyone can help me with that?
I tryed to do a cast:

ALTER TABLE mu ADD COLUMN codigo2 int4;
    UPDATE mu SET codigo2 = CAST(codigo AS int4);
    ALTER TABLE mu DROP COLUMN codigo;

but postgre returns the error message:

ERROR:  Cannot cast type character varying to integer






More information about the postgis-users mailing list