I have used this below query to get the complete information of Sequence objects from the Postgresql catalog table
select s.sequence_name, s.start_value, s.minimum_value, s.maximum_value, s.increment, s.cycle_option
from information_schema.sequences s
where s.sequence_schema='schema1'
One more attribute value am not able to get is "Cache" value.
Am using Postgresql 9.2
Here is the DDL syntax for the sequence with cache,
ALTER SEQUENCE [ IF EXISTS ] name [ INCREMENT [ BY ] increment ]
[ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ]
[ START [ WITH ] start ]
[ RESTART [ [ WITH ] restart ] ]
[ CACHE cache ] [ [ NO ] CYCLE ]
[ OWNED BY { table_name.column_name | NONE } ]
Is there any Postgres functions to get this Sequence cache value ?
Thanks,
Ravi