Re: Improving psql \ds - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Improving psql \ds
Date
Msg-id CA+Tgmob1DLjV_yWZ02p_Wt=9LgHRKaDywyWX6T2uJvux3u+MYQ@mail.gmail.com
Whole thread Raw
In response to Re: Improving psql \ds  (Julien Tachoires <julmon@gmail.com>)
Responses Re: Improving psql \ds  (Julien Tachoires <julmon@gmail.com>)
Re: Improving psql \ds  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-hackers
On Mon, Oct 8, 2012 at 3:49 AM, Julien Tachoires <julmon@gmail.com> wrote:
> 2012/10/8 Tom Lane <tgl@sss.pgh.pa.us>:
>> Julien Tachoires <julmon@gmail.com> writes:
>>> About \ds behaviour, I think to add 2 columns :
>>> - 'LastValue'
>>> - 'Increment'
>>
>> That would make the command a great deal slower, since it would have to
>> access each sequence to get that info.  I don't object to adding such
>> columns to \ds+, but I don't think it's a good idea to put them in the
>> basic command.
>
> Ok.
>
>> The other problem you're going to have here is that there is in fact no
>> such command as "\ds" (nor "\ds+"); rather, it's a special case of
>> \dtsvi.  As such, putting any relkind-specific info into the result is
>> problematic.  I think you're going to have to invent a different command
>> if you want there to be sequence-specific columns.
>
> Yes, that's why I plan to create a new function listSequences() and
> call it from src/bin/psql/command.c :
> +       /* \d* commands */
> +       else if (cmd[0] == 'd')
> +       {
> ...
> +                       case 's':
> +                               success = listSequences(pattern, show_verbose);
> +                               break;

What happens if the user does this:

\dis

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
Next
From: Bruce Momjian
Date:
Subject: Re: Add FET to Default and Europe.txt