This is a discussion on Re: TODO item: Have psql show current values for asequence within the pgsql Hackers forums, part of the PostgreSQL category; --> Wow. I adjusted the patch slightly and applied it; the updated version is attached. We have been waiting for ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Wow. I adjusted the patch slightly and applied it; the updated version is attached. We have been waiting for this to be done for quite some time. Thanks. --------------------------------------------------------------------------- Dickson S. Guedes wrote: > 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@timbira.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...2/msg00102.php > http://archives.postgresql.org/pgsql...2/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, skipping... ] > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| ||||
| Bruce Momjian <bruce@momjian.us> writes: > Wow. I adjusted the patch slightly and applied it; the updated version > is attached. We have been waiting for this to be done for quite some > time. Thanks. Hmm ... I don't think that this patch actually addresses the TODO item. The TODO item seems to have originated here http://anoncvs.postgresql.org/cvsweb...;r2=1.1221;f=h in response to this question on pgsql-novice: > How can I list all the sequences in the database, with their > attributes (such as last_value)? (I'm having a hard time guessing > 'seq-name'; the 'A_id_seq' formula did not work.) http://archives.postgresql.org/pgsql...2/msg00148.php This applied-with-little-discussion patch only shows the sequence values if you do a \d on a specific sequence, or \d on a wildcard that happens to include some sequences (and probably a lot of other stuff too, causing the resulting display to be far too long to be useful). My interpretation of the TODO item has always been that we should improve \ds to include all the useful information in a format that requires only one line per sequence. The reason it has remained undone for four years is that that's hard given the existing catalog representation of sequences and the constraints of describe.c's implementation. (I recall at least one failed patch that tried to do this, though I can't find it in the archives right now.) I find the present patch to be pretty useless: it's not a material advance over doing "select * from sequence-name". I think it should be reverted and the TODO item reinstated --- perhaps with more detail about what the item really is requesting. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |