與mysql不同的是postgre自增id需要先創(chuàng)建一個(gè)sequence CREATE SEQUENCE test_id START 10; 然后給id設(shè)置默認(rèn)值 DEFAULT nextval('test_id'::regclass)