尝试将 auto_increment 添加到现有列
ALTER TABLE table_name ALTER COLUMN id_column SET DEFAULT nextval('table_id_column_seq');
尝试1:
CREATE SEQUENCE table_id_column_seq AS integer START 1 OWNED BY table.id_column;
错误:
错误:序列必须与其链接的表具有相同的所有者
尝试2:
CREATE SEQUENCE table_id_column_seq AS integer START 1 OWNED TO postgres;
错误:
ERROR: syntax error at or near "integer"
LINE 1: CREATE SEQUENCE table_id_column_seq integer START 1...
^
应该是这样吗?