1.序列 以自增serial类型主键的序列: alter sequence s_seq restart with 1; #重置序列select currval('tablename_pid_seq');select nextval('tablename_pid_seq');select setval('tablename_pid_seq',1); 2.修改表 --删除约束alter table tablename alter column col drop not null; --添加约束alt