How to get max_value and min_value Postgres sequence?
I created the sequence using this statement
create sequence seqtest increment 1 minvalue 0 maxvalue 20;
I tried this query select max_value from seqtest
gives error
ERROR: column "max_value" does not exist
LINE 1: select max_value from seqtest;
HINT: Perhaps you meant to reference the column "seqtest.last_value".
Output of select * from seqtest
test=# select * from seqtest;
-[ RECORD 1 ]-
last_value | 0
log_cnt | 0
is_called | f
Copyright Notice:Content Author:「Kax A」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47551628/postgresql-sequence-getting-max-value