Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXh9T-00C5wN-Ss for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Feb 2024 12:35:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rXh9S-00AUqf-Im for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Feb 2024 12:35:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXh9S-00AUqV-4f for pgsql-hackers@lists.postgresql.org; Wed, 07 Feb 2024 12:35:42 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXh9O-005XAo-8H for pgsql-hackers@postgresql.org; Wed, 07 Feb 2024 12:35:40 +0000 Received: from [10.4.12.133] (unknown [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: p.luzanov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id E04E7E210B1; Wed, 7 Feb 2024 15:35:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1707309334; bh=KvFWTu3YHhdGfH9lXKssLjfaT/c/jdUPl4sWyGc/Yzo=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=DbOSUtN9p6UYKIHjkObKChHTh78UYUz40Gf0OkMBcSNJoMHG+S+73NOpVH9Krl21U Lbhnd6DqRf3UahBqAqAmcLGwdtICjCxQDzuF/yiSGoiIqAWmptahIRaKgX1GqTs1MF +pvfy4bVYOuk+1oY9ax/IUWr/2vrXh5p/DbtxHwA19TtniatHUa4Bnc97TtqA933x0 xSJ2cdrpk+PHEF+ZLNYS9fNXWCYbu60q7QAQk/fmcWI8+W/VANYfdysJENHGFh3PWn OlOcrfbmGh26PNKa3ofcp3ynv7UpkFIyAYtrnAxSqabl0z9p6rCmYnIQwEonPFN6t4 Y6sJexsEB6VpQ== Content-Type: multipart/alternative; boundary="------------Ki6ugLIXDlq8riyApUcpjgWJ" Message-ID: <852cabef-f596-4826-9a54-d3f75d9a6cc8@postgrespro.ru> Date: Wed, 7 Feb 2024 15:35:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Psql meta-command conninfo+ Content-Language: en-US, ru-RU To: Maiquel Grassi , Nathan Bossart Cc: Erik Wienhold , "pgsql-hackers@postgresql.org" References: <20240206181919.GA3853632@nathanxps13> <20240206210605.GA3903769@nathanxps13> <20240206211205.GA3903996@nathanxps13> <20240206215022.GA3452@nathanxps13> From: Pavel Luzanov In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------Ki6ugLIXDlq8riyApUcpjgWJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit This is a good idea about extended connection info. On 07.02.2024 07:13, Maiquel Grassi wrote: > SELECT > ... > current_user AS "User", This will be inconsistent with \conninfo. \conninfo returns authenticated user (PQuser), not the current_user. It might be worth showing current_user, session_user, and authenticated user, but I can't find the appropriate sql function for PQuser. What about to include system_user function? It shows useful authentication details. Also, it seems that the verbose parameter in the listConnectionInformation is unnecessary. -- Pavel Luzanov Postgres Professional:https://postgrespro.com --------------Ki6ugLIXDlq8riyApUcpjgWJ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
This is a good idea about extended connection info.

On 07.02.2024 07:13, Maiquel Grassi wrote:
SELECT
...
  current_user AS "User",
This will be inconsistent with \conninfo.
\conninfo returns authenticated user (PQuser), not the current_user.
It might be worth showing current_user, session_user, and authenticated user,
but I can't find the appropriate sql function for PQuser.

What about to include system_user function? It shows useful authentication details.

Also, it seems that the verbose parameter in the listConnectionInformation
is unnecessary.
-- 
Pavel Luzanov
Postgres Professional: https://postgrespro.com
--------------Ki6ugLIXDlq8riyApUcpjgWJ--