TODO item: Have psql show current values for a sequence

From: "Dickson S(dot) Guedes" <guediz(at)gmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: TODO item: Have psql show current values for a sequence
Date: 2008-05-24 03:27:16
Message-ID: f0b79c6f0805232027j4771b7do1ca7dd7ce5c85335@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi all,

These patch implements the TODO item: Have psql show current values
for a sequence.
Comments are welcome.

* Credits

The original patch were developed by Euler Taveira de Oliveira
<euler(at)timbira(dot)com>
but how he is a little busy, he sends it to me and I made some changes
to satisfy
the TODO item above.

* Discussions

http://archives.postgresql.org/pgsql-hackers/2007-12/msg00102.php
http://archives.postgresql.org/pgsql-hackers/2007-12/msg00605.php

* Outputs

# \d foo_bar_seq
Sequence "public.foo_bar_seq"
+---------------+---------+---------------------+
| Column | Type | Value |
+---------------+---------+---------------------+
| sequence_name | name | foo_bar_seq |
| last_value | bigint | 11 |
| start_value | bigint | 1 |
| increment_by | bigint | 1 |
| max_value | bigint | 9223372036854775807 |
| min_value | bigint | 1 |
| cache_value | bigint | 1 |
| log_cnt | bigint | 31 |
| is_cycled | boolean | f |
| is_called | boolean | t |
+---------------+---------+---------------------+

# \d+ foo_bar_seq
Sequence "public.foo_bar_seq"
+---------------+---------+---------------------+-------------+
| Column | Type | Value | Description |
+---------------+---------+---------------------+-------------+
| sequence_name | name | foo_bar_seq | |
| last_value | bigint | 11 | |
| start_value | bigint | 1 | |
| increment_by | bigint | 1 | |
| max_value | bigint | 9223372036854775807 | |
| min_value | bigint | 1 | |
| cache_value | bigint | 1 | |
| log_cnt | bigint | 31 | |
| is_cycled | boolean | f | |
| is_called | boolean | t | |
+---------------+---------+---------------------+-------------+

--
[]s
Dickson S. Guedes
--------------------------------------
Projeto Colmeia - Curitiba - PR
+55 (41) 3254-7130 ramal: 27
http://makeall.wordpress.com/
http://pgcon.postgresql.org.br/
http://planeta.postgresql.org.br/

Attachment Content-Type Size
psql-show-current-values-for-sequence-v2.diff.gz application/x-gzip 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2008-05-24 03:57:16 Re: Fragments in tsearch2 headline
Previous Message Joshua D. Drake 2008-05-24 00:57:13 Re: \df displaying volatility

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-05-24 03:59:29 Re: \d+ should display the storage options for columns
Previous Message David Fetter 2008-05-23 20:38:28 Re: [HACKERS] WITH RECURSIVE patch V0.1