建表后操作 table_test :表名称 id:字段名称 CREATE SEQUENCE test_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE table_test ALTER COLUMN id SET DEFAULT nextval( 'test_id_seq' );