Set the start value of the SERIAL type data in PostgreSQL database

I have been searing online to find a way to set the default start value of the serial type data use in the alter command without success.
But I did have an alternative solution to solve this problem by first defining the sequence, which is used by the serial type:
create sequence seqnbr_student_17 start 588280;
alter table student_17 add seqnbr integer not null default nextval(‘seqnbr_student_17 ’);
By doing this two lines of code you have actually defined a serial field with the start value 588280.

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...