I have a table:
create table DB.t1 (id SERIAL,name varchar(255));
and insert some data:
insert into DB.t1 (name) values (\'nam
You can implement a trigger function on inserting. This function will chck if NEW.id is not null and update the sequence related to the id field.
IF NEW.id IS NOT NULL THEN SELECT SETVAL(sequence_name_of_id_field,NEW.id); END IF;