I have a simple question, suppose we have a table:
id A B 1 Jon Doe 2 Foo Bar
Is there a way to know, which is the next id\'s
SELECT currval('names_id_seq') + 1;
See the docs
However, of course, there's no guarantee that it's going to be your next value. What if another client grabs it before you? You can though reserve one of the next values for yourself, selecting a nextval from the sequence.
nextval