séquence postgresql code example
Example 1: psql get sequences
# Get all sequences
SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';
# Get last value of a sequence
SELECT last_value FROM test_id_seq;
Example 2: postgresql alter table sequence
alter sequence your_sequence restart with 1000;
Example 3: create sequence postgres
CREATE SEQUENCE mysequence
INCREMENT 5
START 100;