Forum OpenACS Q&A: Response to alter column type problem.

Collapse
Posted by David Kuczek on
Hello Janine,

what I do is:

1.) I create a new table called students_new with mark_1 mark_2 mark_3 being changed from numeric to varchar(20).

2.) CREATE TABLE temp AS SELECT * FROM students.

3.) INSERT INTO students_new SELECT * FROM temp;

This is where the error appears:

ERROR:  Attribute 'mark_1' is of type 'varchar' but expression is of type 'numeric'

You will need to rewrite or cast the expression

I don't drop columns, but just alter their data types...