alter serial to id postgresql

CREATE SEQUENCE my_serial AS integer START 1 OWNED BY address.new_id;

ALTER TABLE address ALTER COLUMN new_id SET DEFAULT nextval('my_serial');

posted @ 2022-06-30 15:24  CrossPython  阅读(18)  评论(0编辑  收藏  举报