I have table with id and name where id is the primary key with bigint as the datatype. Now I want to alter the column, where id as the primary key with auto incremented value.
My Table:
CREATE TABLE test(
testid bigint NOT NULL,
testname character varying(255),
CONSTRAINT test_pkey PRIMARY KEY (testid)
);
Alter query:
ALTER TABLE test ALTER COLUMN testid BIGSERIAL PRIMARY KEY;
After executing the query I'm getting the following error,
ERROR: syntax error at or near "BIGSERIAL"
LINE 1: ALTER TABLE test ALTER COLUMN testid BIGSERIAL P...
^
********** Error **********
ERROR: syntax error at or near "BIGSERIAL"
SQL state: 42601
Character: 50