title: How to view sequence details with a SQL
body: <p>As you know, we can view the details of a sequence by using '\d' command.
  I would like to know if there is a way to get these information with a SQL query so that I can view the details for all sequences in PostgreSQL database.</p>
  
  <p>Eventually, the left 'Column' will be displayed horizontally like we see normally when we use a sql statement.</p>
  
  <pre><code>postgres=# \d next_empno
           Sequence "public.next_empno"
      Column     |  Type   |        Value        
  ---------------+---------+---------------------
   sequence_name | name    | next_empno
   last_value    | bigint  | 8000
   start_value   | bigint  | 8000
   increment_by  | bigint  | 1
   max_value     | bigint  | 9223372036854775807
   min_value     | bigint  | 1
   cache_value   | bigint  | 1
   log_cnt       | bigint  | 0
   is_cycled     | boolean | f
   is_called     | boolean | f
  </code></pre>