test=# create temp sequence test_seq;
CREATE SEQUENCE
test=# select nextval('test_seq'), name from test;
nextval | name
---------+------------
1 | name text
2 | zms text
3 | smz text
4 | name text
5 | zms text
6 | smz text
7 | name text
8 | zms text
9 | smz text