1、自增主键;2、创建序列
create table test_no( id SERIAL primary key, name varchar(20) );
CREATE SEQUENCE test_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
应用:
测试:
select nextval('test_seq');