Improving psql \ds

From: Julien Tachoires <julmon(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Improving psql \ds
Date: 2012-10-07 21:06:56
Message-ID: CAFEQCbEtA5QSXOyr16cz3K-ydQ1Zj8p6yVLkHptK1d4aDjdYjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I would like to work on psql \ds improvements. Here's my idea :
- in src/bin/psql/describe.c, add a new function :
listSequences(*pattern, verbose) wich will list sequences and remove
code related to sequences from listTables()
- in src/bin/psql/command.c, call listSequences() on \ds
- about listSequences() implementation :
- get list from pg_catalog.pg_class WHERE relkind = 'S'
- for each seq. name, get details using : SELECT * FROM <seqname>;
(is there an other way to do that ?)

About \ds behaviour, I think to add 2 columns :
- 'LastValue'
- 'Increment'

for \ds+ :
- all extras informations available from the sequence table.

BTW, why don't we get last_value value with
pg_catalog.pg_sequence_parameters(oid) ? I guess this is because
last_value is not a parameter... Perhaps, having a
pg_sequence_all(oid) or something like that, giving all informations
from the seq. table could be usefull.

Thought ?

Cheers,

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2012-10-07 21:54:00 Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Previous Message Brar Piening 2012-10-07 18:30:22 Re: Visual Studio 2012 RC