Re: Psql meta-command conninfo+

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Hunaid Sohail <hunaidpgml(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: Psql meta-command conninfo+
Date: 2025-02-21 20:33:26
Message-ID: 3661902.1740170006@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sami Imseih <samimseih(at)gmail(dot)com> writes:
>> Maybe keeping track of 'role' via ParameterStatus messages is a good
>> idea for reasons unrelated to this patch -- maybe it can be useful for
>> applications to be aware of role changes -- but I'm not 100% sure about
>> that, and in particular I'm not sure how heavy the protocol traffic is
>> going to be if such messages are emitted every time you run a security
>> invoker function or things like that

> With the latest version of the patch, 'role' is not needed as
> 'session authorization' is not shown either [1].

FWIW, the server currently sends at most one ParameterStatus change
report per query. So I don't think that there is a huge performance
argument against making 'role' be GUC_REPORT. On the other hand,
supporting \conninfo is a pretty lousy argument for doing so ---
surely we don't need a constantly-updated value to support a
seldom-used command. Moreover, if \conninfo depended on that
it wouldn't work with older servers.

If we want to include 'role' in this output, what I'd propose is to
have \conninfo issue "SHOW role", which is accepted by every server
version. If it fails (say because we're in an aborted transaction),
just omit that row from the output.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-21 20:49:10 Re: Statistics Import and Export
Previous Message Andres Freund 2025-02-21 20:23:00 Re: Statistics Import and Export