CREATE SEQUENCE mytable_item_id_seq OWNED BY mytable. item_id; ALTER TABLE mytable ALTER item_id SET DEFAULT nextval('mytable_item_id_seq');