nextval ( regclass ) → bigintAdvances the sequence object to its next value and returns that value. This is done atomically: even if multiple sessions execute
nextval concurrently, each will safely receive a distinct sequence value. If the sequence object has been created with default parameters, successive nextval calls will return successive values beginning with 1. Other behaviors can be obtained by using appropriate parameters in the CREATE SEQUENCE command.