Hi,
You cannot, as far as I am aware, change a column's datatype. This is because the database cannot necessarily be expected to know how to transform a columns data from one datatype to another. How for example could you tranform a string to an int?
The most you could hope to do is insert a new column and delete the old one. You can insert a new column into an existing table by:
ALTER TABLE mytable ADD newcolumn int(10);
However, PostgreSQL is not fully SQL92 compliant with this command though and does not implement a DROP clause. Therefore, to drop a column you have to actually recreate the database:
CREATE TABLE temp AS SELECT col1, newcolumn FROM mytable;
DROP TABLE;
CREATE TABLE mytable (
col1 int,
newcolumn int(10)
);
INSERT INTO mytable SELECT * FROM temp;
DROP TABLE temp;
Pretty nasty really. Yuck!
HTH. All the best,
Louis