Re: Improving psql \ds

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Julien Tachoires <julmon(at)gmail(dot)com>, 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 18:57:38
Message-ID: 50732222.8020200@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/10/12 03:53, Robert Haas wrote:
> 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...

'According' to Terry Prachett,that is probably short hand for telling
the backend to go to Hell = 'dis' is apparently another name for 'Hell'!
(In his book 'Truth', commander Vimes has a personal dis-organiser - as
the 'dis-organiser' is run by a demon from Hell.)

Now back to more appropriate comments...

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2012-10-08 19:20:25 Re: Add FET to Default and Europe.txt
Previous Message Bruce Momjian 2012-10-08 18:40:26 getopt() and strdup()