How do i do to alter a table column in serial. This column has already datas in it and i don't want to lost them.. I have tried this:
ALTER TABLE tbl_user ADD COLUMN usr_id SERIAL PRIMARY KEY;
i get this error
ERROR: column "usr_id" of relation "tbl_user" already exists ********** Erreur **********
i tried this also:
UPDATE tbl_user SET usr_id = nextval('seq_user') WHERE usr_id IS NULL;
Query returned successfully: 0 rows affected, 71 msec execution time.
the query turn succesfull but doesn't change the column type