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 1rXQqX-00AdRz-9Z for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 19:11:06 +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 1rXQqW-006D8f-CP for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 19:11:04 +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 1rXQqV-006D8X-Rs for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 19:11:03 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXQqS-005PbS-SN for pgsql-hackers@postgresql.org; Tue, 06 Feb 2024 19:11:02 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4TTtBS329cz9sdB; Tue, 6 Feb 2024 20:10:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1707246656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wWQYYfz+mJS9xbF49szQ/tpUGQ8I+qnv1mbe2LCPsmw=; b=gF1gW7529ecU+RLdMYOjTk3OtJYwY8Oe1ezwnysQK7k5EEjscMaIr5kvKTVUn0TwI7iSDG HPGwWJ9KG6rXbR8lXl6XWBGpR8btxgbzOz9/IICEcPuMy5mtSXln7AFXyjsg20RTXUhqYT M3Eu52NCesjKj7E2QuoTVMW9GxTaTtkoHeN0LTROgT7m+mZMrj9hK6NSBziRo2JOfEhUkP jGgdXCxWYIjadCN0avuqMw6QS/54VEZ8+hDD+SJckGIuDyTHR4O4nugBjXPCtOQkmVqJDp VgwiUwjmMt5WYJvzEv38DMhoRSVQau8dyXHA4dENJWEp8Io9XjXHQBexaY8sxQ== Date: Tue, 6 Feb 2024 20:10:54 +0100 From: Erik Wienhold To: Nathan Bossart Cc: Maiquel Grassi , "pgsql-hackers@postgresql.org" Subject: Re: Psql meta-command conninfo+ Message-ID: References: <20240206181919.GA3853632@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240206181919.GA3853632@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-02-06 19:19 +0100, Nathan Bossart wrote: > On Tue, Feb 06, 2024 at 05:27:01PM +0000, Maiquel Grassi wrote: > > postgres=# \conninfo+ > > Current Connection Information > > Attribute | Value > > ----------------+---------------- > > Database | postgres > > User | postgres > > Server Version | 16.1 > > Server Address | 192.168.0.5/32 > > Server Port | 5433 > > Client Address | 192.168.0.5/32 > > Client Port | 52716 > > Session PID | 21624 > > (8 rows) > > My first reaction is that this should instead return a single row with the > same set of columns for any connection type (the not-applicable ones would > just be set to NULL). That would match the other meta-commands like \l and > \du, and you could still get an expanded display with \x if needed. Also, > I think it would simplify the code a bit. +1 for a single-row result and triggering expanded display with \x for consistency with other commands. -- Erik