set primary key state