trying to add auto_increment to an existing column
ALTER TABLE table_name ALTER COLUMN id_column SET DEFAULT nextval('table_id_column_seq');
try 1:
CREATE SEQUENCE table_id_column_seq AS integer START 1 OWNED BY table.id_column;
Error:
ERROR: sequence must have same owner as table it is linked to
try 2:
CREATE SEQUENCE table_id_column_seq AS integer START 1 OWNED TO postgres;
Error:
ERROR: syntax error at or near "integer"
LINE 1: CREATE SEQUENCE table_id_column_seq integer START 1...
^
As it should be?
identity
columns are the preferred way to create an "auto increment" column these days