Skip to content

Instantly share code, notes, and snippets.

View pgnickb's full-sized avatar

Nick Babadzhanian pgnickb

View GitHub Profile
10:40 nick@nick *=# select * from generate_series(1, 100) f(i) where pg_try_advisory_lock(i) limit 5;
i
───
1
2
3
4
5
(5 rows)
nick=# select * from nextval('sg', 100);
count | first_value | last_value | increment
-------+-------------+------------+-----------
100 | 2033 | 2133 | 1
(1 row)