\describe*

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема \describe*
Дата
Msg-id CADkLM=eHUZEMi+M=JjvbdLNBSW6oiSYBpadEq0hvXhtoQd+vfw@mail.gmail.com
обсуждение исходный текст
Ответы Re: \describe*
Re: \describe*
Re: \describe*
Список pgsql-hackers
Some of the discussions about making psql more user friendly (more tab completions help, exit, etc) got me thinking about other ways that psql could be more friendly, and the one that comes to mind is our terse but cryptic \d* commands.

I think it would be helpful and instructive to have corresponding long-form describe commands. 

Take describing schemas. Is \dn intuitive? Not really. In hindsight, you may think "yeah, a schema is a namespace", but you never guessed 'n' on the first try, or the second.

Looking over exec_command_d() a bit, I think it's a bit of a stretch do have each command handle a long form like this:

\describe table my_table
or
\describe table verbose my_table

because then each \d-variant has to account for objects named "table" and "verbose" and that's a path to unhappiness.

But if we dash-separated them, then all of the strcmps would be in the 'e' subsection, and each one would just have to know it's long to short translation, and call exec_command_d with the corresponding short command

describe => d
describe-verbose => d+
describe-aggregates-verbose => da+
describe-roles => du

We could even presume the verbose flag in all cases (after all, the user was being verbose...), which would also cut down on tab-completion results, and we could check for interactive mode and display a message like

\describe-schemas (short: \dn+)

so that the person has the opportunity to learn the corresponding short command.

In additional to aiding tab completion discovery of the commands (i.e. typing "\desc" and then hitting tab, it would also make scripts a little more self-documenting.

Thoughts?

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] GnuTLS support
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Removing WITH clause support in CREATE FUNCTION, for isCachableand isStrict