Using Sequences

* Sequences are a PostgreSQL extension to SQL that allows to generate unique number IDs in one atomic operation.

* Example:

test=> CREATE SEQUENCE my_seq \g
CREATE
test=> SELECT NEXTVAL('my_seq') \g
nextval
-------
      1
(1 row)

test=> SELECT NEXTVAL('my_seq') \g
nextval
-------
      2
(1 row)