postgresql 字段sql语句 更改表名

1.更改表名 

alter table 表名 rename to 新表名

2.更改字段名

alter table 表名 rename 字段名 to 新字段名

3,更改字段类型

如:ID 字段 原类型为 character varying(50) 新类型为integer

其中,ID中原有数据为1,2,3等数字

用如下语句更改

 alter table dbo.titemtype alter column id type integer using to_number(id,'9');


猜你喜欢

转载自blog.csdn.net/sq8706/article/details/7077148