i moved postgresql database to another server and migrated datas to new postgresql server.
it started from 1 but there were 1470 datas in messages table.
you just need to change postgresql nextval with SETVAL
open your database properties (i used dbeaver for it)
find message_id column default value like
nextval('messages.messages_message_id_seq'::regclass)
open the sql editor and execute the code
firstly, just check your nextval with
SELECT nextval('messages.messages_message_id_seq');
now set your wish, i wish it is better 1470 for my situation.
select setval ('messages.messages_message_id_seq', 1473)
to check your nextval
SELECT nextval('messages.messages_message_id_seq');
c u