Skip site navigation (1) Skip section navigation (2)

Re: Improving psql \ds

From: Julien Tachoires <julmon(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving psql \ds
Date: 2012-10-08 15:02:48
Message-ID: CAFEQCbFydwvg6xnis3UJS6oxdU=gSizq4g3RJ5=oeH-ktRXkyA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
2012/10/8 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Mon, Oct 8, 2012 at 3:49 AM, Julien Tachoires <julmon(at)gmail(dot)com> wrote:
>> 2012/10/8 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>> Julien Tachoires <julmon(at)gmail(dot)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

hmm, you're right, this is not a good idea.


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-10-08 15:09:22
Subject: Re: why can't plpgsql return a row-expression?
Previous:From: Tom LaneDate: 2012-10-08 14:59:59
Subject: Re: Improving psql \ds

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group