数据库修改字段类型:
ALTER TABLE the_table ALTER COLUMN col_name TYPE integer USING (col_name::integer);如果字段内容里包含有空格,使用:
ALTER TABLE the_table ALTER COLUMN col_name TYPE integer USING (trim(col_name)::integer);
数据库修改字段名:
ALTER TABLE the_table RENAME COLUMN col_name1 TO col_name2