Re: proposal: psql: show current user in prompt

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: psql: show current user in prompt
Дата
Msg-id CAFj8pRCV18R57DoAoDL59N5pNQBRUmQpki_oxrWjFFh_sDu2rg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: psql: show current user in prompt  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: psql: show current user in prompt  (Kirk Wolak <wolakk@gmail.com>)
Список pgsql-hackers
Hi

pá 3. 2. 2023 v 21:43 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal:


pá 3. 2. 2023 v 21:21 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
Pavel Stehule <pavel.stehule@gmail.com> writes:
> Both patches are very simple - and they use almost already prepared
> infrastructure.

It's not simple at all to make the psql feature depend on marking
"role" as GUC_REPORT when it never has been before.  That will
cause the feature to misbehave when using older servers.  I'm
even less impressed by having it fall back on PQuser(), which
would be misleading at exactly the times when it matters.

It is a good note. This can be disabled for older servers, and maybe it can  introduce its own GUC (and again - it can be disallowed for older servers).

Here is another version. For older servers it shows the string ERR0A000. That is  ERR code of "feature is not supported"


My goal at this moment is to get some prototype. We can talk if this feature request is valid or not, and we can talk about implementation.

There is another possibility to directly execute "select current_user()" instead of looking at status parameters inside prompt processing. It can work too.

I tested using the query SELECT CURRENT_USER, but I don't think it is usable now, because it doesn't work in the broken transaction.

Regards

Pavel

 

Regards

Pavel





                        regards, tom lane
Вложения

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

Предыдущее
От: Nitin Jadhav
Дата:
Сообщение: Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: proposal: psql: psql variable BACKEND_PID