PostgreSQL column type conversion from bigint to bigserial
As explained in the documentation, SERIAL is not a datatype, but a shortcut for a collection of other commands. So while you can’t change it simply by altering the type, you can achieve the same effect by running these other commands yourself: CREATE SEQUENCE temp_id_seq; ALTER TABLE temp ALTER COLUMN id SET NOT NULL; ALTER … Read more