The following statement doesn't work:
ALTER TABLE my_table
ALTER COLUMN column_id set default nextval('my_table_column_id_seq');
So how to change id column to auto increment?
Error:
null value in column \"column_id"\ violates non null constraint.
This happens when I insert without column_id. I need it to be auto increment. Postgres Version is 12.
My insert:
INSERT INTO my_table (column2, column3)
VALUES ('rndmstring', 5);