I\'ve a little problem with serial : From a file, I filled my database in which I have a client ID (it is a serial and it is my primary key). I have 300 clients so 300 client ID
The solutions above did not work for what I needed.
I needed a serial id to use as a primary key that started from 1000, rather than 1.
In order to do this, I created a standard serial column:
ALTER table my_table ADD COLUMN new_id SERIAL PRIMARY KEY;
and then updated that column:
UPDATE my_table set new_id = new_id + 1000;
I then joined that table to the table with existing non-consecutive id numbers under 1000.