需要为主键创建一个序列:
在创建表之后,创建sequence
CREATE SEQUENCE event_id_seq
START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; alter table event alter column id set default nextval('event_id_seq');
CREATE SEQUENCE article_keywords_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 16 CACHE 1; ALTER TABLE article_keywords_id_seq OWNER TO postgres;原文链接:https://www.f2er.com/postgresql/196299.html