D
D
di2020-01-14 15:01:57
PostgreSQL
di, 2020-01-14 15:01:57

How to get the increment of the created sequence?

Created an example sequence

create sequence public.example minvalue 2000 start 2000 increment 1000;

How can I find out increment by query?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2020-01-14
@Delgus

information_schema.sequences is the correct answer, only the schema name should also be taken into account so as not to accidentally get several lines from different schemas.
In postgresql 10+, you can access the system directory like this
Before release 10, look at (not at hand to specify the field name) But if postgresql implementation details are not needed, then information_schema.sequences will probably be more appropriate. unlikely to change in major releases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question