Improving psql \ds - Mailing list pgsql-hackers

From Julien Tachoires
Subject Improving psql \ds
Date
Msg-id CAFEQCbEtA5QSXOyr16cz3K-ydQ1Zj8p6yVLkHptK1d4aDjdYjA@mail.gmail.com
Whole thread Raw
Responses Re: Improving psql \ds
List 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,



pgsql-hackers by date:

Previous
From: Brar Piening
Date:
Subject: Re: Visual Studio 2012 RC
Next
From: Tom Lane
Date:
Subject: Re: Improving psql \ds