On Wed, Nov 27, 2024 at 3:14 PM Raphael Salguero Aragón
wrote:
> Am 23.09.2024 um 17:37 schrieb Dominique Devienne :
> > I'd be glad to use Pavel's proposed %N. —DD
> I just wanted to add that we are also supporting a larger customer with
> exactly the same request.
> Perhaps this increases the v
Am 23.09.2024 um 17:37 schrieb Dominique Devienne :
>
> On Mon, Sep 23, 2024 at 5:16 PM Adrian Klaver
> wrote:
>> On 9/23/24 08:07, Dominique Devienne wrote:
>>> I often resort to \conninfo, but it's less automatic and
>>> harder to visually parse (IMHO) compared to a custom ad-hoc prompt.
>
>>
Adrian Klaver writes:
> On 9/23/24 08:07, Dominique Devienne wrote:
>> I often resort to \conninfo, but it's less automatic and
>> harder to visually parse (IMHO) compared to a custom ad-hoc prompt.
> For me that shows the user that connected(session_user) not the
> current_user.
Worse than tha
On Mon, Sep 23, 2024 at 5:16 PM Adrian Klaver wrote:
> On 9/23/24 08:07, Dominique Devienne wrote:
> > I often resort to \conninfo, but it's less automatic and
> > harder to visually parse (IMHO) compared to a custom ad-hoc prompt.
> For me that shows the user that connected(session_user) not the
On 9/23/24 08:07, Dominique Devienne wrote:
On Mon, Sep 23, 2024 at 4:55 PM Tom Lane wrote:
Laurenz Albe writes:
To get the current role, psql would have to query the database whenever
it displays the prompt. That would be rather expensive...
See previous discussion:
https://www.postgresql
On Mon, Sep 23, 2024 at 4:55 PM Tom Lane wrote:
> Laurenz Albe writes:
> > To get the current role, psql would have to query the database whenever
> > it displays the prompt. That would be rather expensive...
>
> See previous discussion:
> https://www.postgresql.org/message-id/flat/CAFj8pRBFU-Wz
Laurenz Albe writes:
> To get the current role, psql would have to query the database whenever
> it displays the prompt. That would be rather expensive...
See previous discussion:
https://www.postgresql.org/message-id/flat/CAFj8pRBFU-WzzQhNrwRHn67N0Ug8a9-0-9BOo69PPtcHiBDQMA%40mail.gmail.com
At
On Mon, Sep 23, 2024 at 3:05 PM Laurenz Albe wrote:
> On Mon, 2024-09-23 at 14:59 +0200, Dominique Devienne wrote:
> > On Mon, Sep 23, 2024 at 2:51 PM Erik Wienhold wrote:
> > > You could instead use this:
> > >
> > > SELECT current_role \gset
> > > \set PROMPT1 '%n@%/ (%:current_role:)=%
On Mon, 2024-09-23 at 14:59 +0200, Dominique Devienne wrote:
> On Mon, Sep 23, 2024 at 2:51 PM Erik Wienhold wrote:
> > You could instead use this:
> >
> > SELECT current_role \gset
> > \set PROMPT1 '%n@%/ (%:current_role:)=%# '
> >
> > But that won't work with subsequent SET ROLE comman
On Mon, Sep 23, 2024 at 8:22 AM Asad Ali wrote:
> There is no direct prompt escape sequence like %n for displaying the
> current_role in the psql prompt. However, you can work around this by using
> a \set command to define a custom prompt that includes the result of
> current_role.
>
Please do
On Mon, Sep 23, 2024 at 2:51 PM Erik Wienhold wrote:
> You could instead use this:
>
> SELECT current_role \gset
> \set PROMPT1 '%n@%/ (%:current_role:)=%# '
>
> But that won't work with subsequent SET ROLE commands.
Bummer... That was kinda the point, that it updates automatically.
Then
On 2024-09-23 14:22 +0200, Asad Ali wrote:
> There is no direct prompt escape sequence like %n for displaying the
> current_role in the psql prompt. However, you can work around this by using
> a \set command to define a custom prompt that includes the result of
> current_role.
> You can use the fo
- Mail original -
> De: "Dominique Devienne"
> À: "Asad Ali"
> Cc: pgsql-gene...@postgresql.org
> Envoyé: Lundi 23 Septembre 2024 14:34:39
> Objet: Re: Customize psql prompt to show current_role
> On Mon, Sep 23, 2024 at 2:22 PM Asad Ali wrot
On Mon, Sep 23, 2024 at 2:22 PM Asad Ali wrote:
> There is no direct prompt escape sequence like %n for displaying the
> current_role in the psql prompt.
> However, you can work around this by using a \set command to define a custom
> prompt that includes the result of current_role.
Hi Ali. Doe
Hi Dominique,
There is no direct prompt escape sequence like %n for displaying the
current_role in the psql prompt. However, you can work around this by using
a \set command to define a custom prompt that includes the result of
current_role.
You can use the following command to set your psql PROMP
15 matches
Mail list logo