Re: allow psql to watch \dt

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: allow psql to watch \dt
Дата
Msg-id 22703.1526088601@sss.pgh.pa.us
обсуждение исходный текст
Ответ на allow psql to watch \dt  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> I thought that would be desirable, although I don't see any better way of
> getting there than this.

Hm, but a lot of the \d commands involve more than one underlying query,
as well as a bunch of postprocessing.  I doubt that the approach you seem
to be using here can handle such cases.

I think you have also stomped all over the semantics of
query-buffer-related commands that are executed in the vicinity of a \d.
Up to now, \d didn't change the query buffer.  That has its uses, eg

    select somecol
    \dt some*           -- how's that table spelled again?
    from sometable;

We could maybe think about making it work by moving the \watch repetition
up a level, so that exec_command() as a whole would be repeated ... but
I wonder what people would think repetition of other commands such as \i,
\e, \r, \if, etc etc should mean.

On the whole I think this is not a can of worms I want to open.  There's
a clear distinction right now between plain SQL and backslash commands,
and this is going to fuzz that in ways that are hard to predict the
consequences of.

            regards, tom lane


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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: allow psql to watch \dt
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Compiler warnings with --enable-dtrace