Create sequence starting with maximum id from a table
Create the sequence, then set the value afterwards:

create sequence some_seq;
select setval('some_seq', (select max(id) from some_table));


You probably also want to "link" the sequence to the table's column as well: 

alter sequence some_seq
  owned by some_table.id;




For modern Postgres version (>= 10), it is recommended to use an identity column instead:

alter table some_table
   alter id add generated always as identity;

select setval(pg_get_serial_sequence('some_table', 'id'), (select max(id) from some_table));