I'm looking for query which will give the complete metadata of sequence.
When I tried in console with the below query I got the metadata.
\d+ phonebook_id_seq
Sequence "public.phonebook_id_seq"
Column | Type | Value | Storage
---------------+---------+---------------------+---------
sequence_name | name | phonebook_id_seq | plain
last_value | bigint | 2 | plain
start_value | bigint | 1 | plain
increment_by | bigint | 1 | plain
max_value | bigint | 9223372036854775807 | plain
min_value | bigint | 1 | plain
cache_value | bigint | 1 | plain
log_cnt | bigint | 31 | plain
is_cycled | boolean | f | plain
is_called | boolean | t | plain
I'm looking for query which will give same output.
I tried below, however I'm not getting the complete metadata info as above.
I tried this query:
SELECT *
FROM information_schema.sequences
WHERE sequence_name = 'phonebook_id_seq';
Output:
'postgres','public','phonebook_id_seq','bigint',64,2,0,'1','1','9223372036854775807','1','NO'