Re: [PATCH] Connection time for \conninfo

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [PATCH] Connection time for \conninfo
Дата
Msg-id 20200310173801.GI3195@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: [PATCH] Connection time for \conninfo  (David Steele <david@pgmasters.net>)
Ответы Re: [PATCH] Connection time for \conninfo  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Re: [PATCH] Connection time for \conninfo  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Greetings,

* David Steele (david@pgmasters.net) wrote:
> On 2/27/20 4:21 AM, Peter Eisentraut wrote:
> >My opinion is that this is not particularly useful and not appropriate to
> >piggy-back onto \conninfo.  Connection information including host, port,
> >database, user name is a well-established concept in PostgreSQL programs
> >and tools and it contains a delimited set of information. Knowing what
> >server and what database you are connected to also seems kind of
> >important.  Moreover, this is information that is under control of the
> >client, so it must be tracked on the client side.

I have to say that I disagree.  Wishing to know when you connected to a
server is entirely reasonable and it's also rather clearly under control
of the client (though I don't entirely understand that argument in the
first place).

> >Knowing how long you've been connected on the other hand seems kind of
> >fundamentally unimportant.  If we add that, what's to stop us from adding
> >other statistics of minor interest such as how many commands you've run,
> >how many errors there were, etc.  The connection time is already
> >available, and perhaps we should indeed make it a bit easier to get, but
> >it doesn't need to be a psql command.

Of 'minor' interest, or not, if it's something you'd like to know then
it's pretty handy if there's a way to get that info.  This also isn't
inventing a new psql command but rather adding on to one that's clearly
already a 'creature comfort' command as everything included could be
gotten at in other ways.

As for the comparison to other things of minor interest, we do give
users a way to get things like line number (%l in PROMPT), so including
something akin to that certainly doesn't seem out of the question.
Having a '%T' or something in the prompt for connected-at-time seems
like it could certainly be useful too.

Going a bit farther, I wonder if conninfo could be configurable as a
Prompt-like string, that seems like it'd be pretty neat.

Anyway, I don't anticipate having time to do anything with this patch
but I disagree that this is a "we don't want it" kind of thing, rather
we maybe want it, since someone cared enough to write a patch, but the
patch needs work and maybe we want it to look a bit different and be
better defined.

Thanks,

Stephen

Вложения

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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: pg_stat_progress_basebackup - progress reporting forpg_basebackup, in the server side
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library