将varchar变为整数类型: alter table 表名 alter column 字段名 type int USING 字段名::int;创建序列(从1开始自增) CREATE SEQUENCE 序列名 START 1;使用序列 nextval(‘序列名’::regclass)