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 1rrKQw-00GusY-JJ for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 16:22:55 +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 1rrKQv-00GpMV-HV for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 16:22:53 +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 1rrKQu-00GpM2-5R for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 16:22:53 +0000 Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrKQq-007eAh-2X for pgsql-hackers@postgresql.org; Mon, 01 Apr 2024 16:22:50 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 15E4E18000EF; Mon, 1 Apr 2024 12:22:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 01 Apr 2024 12:22:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711988564; x= 1712074964; bh=3iZlWMNRc/wpM66BhKezXvM34AfYc/4jsIlSyzOW6U8=; b=K vEL6mKF3WJuc/7NN24AkRO6RmMN1gzEvFdslOCZRxhtqq+Xd4z7r2hJEMTGyAmq0 OLdpW5c2uEnwFahKQyRNlnvuyhgNtc4yWBolEvbTMdmiFLb3g4we8pF+uX2J6sXq A33nEic8feZpXrK/bUquaekBJH4vX2P8vmdBUjsMAiHRChntGm/e1iOT9FFX5+Hb tDg6DyRnPTOBtk+txhSmlwz5kd4VzoXs4GFb9UUC0B7WKl7uVqRu741MB6xGzm8b JtGNFdqhlnOtAWBJdB4phaepiCOJwtPNEqdQRT4CNjcv2c7lu1ZwuEZL/OgIYuuv Q02dpLEa0QPhBb/UL6L5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeftddguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Apr 2024 12:22:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1711988561; bh=Hwgs0hcIHXLkrfLpXpTC6tCtyA47tAXphdNivQrxib4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LWga6uSKsS5d5uiBvg7+0Mus8U4Ix+FOuUsd8hl6kx15cKcS5lWyEBQfCj7ChK1DT 6QMRS4NIELim30T6ufly42nahAB6XFDr0x29x8G3W6ZMDwm57947p4hQapXx2DKKQ4 gQaRKv5rz0wOBtn8ULBbQzO3bixnRQUDmCm47rHptNbpN0ruFY04Aas68Vf63gW/KY QJmiKuaMiuT4YDxK4M/L3BwJt0syMuilHJXHh23eb1GUJjhEvYzm6LSp+TP/S/0ncl hOuo80+9GcmwKTcyops+lfmhK2O0Xi1QG09DTCbEYiXb7jLlCnHV+3Y63fe9HjB/gC bXSQcrZEgV02g== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 083EB385; Mon, 1 Apr 2024 18:22:41 +0200 (CEST) Date: Mon, 1 Apr 2024 18:22:41 +0200 From: Alvaro Herrera To: Maiquel Grassi Cc: "Imseih (AWS), Sami" , Nathan Bossart , Jim Jones , Pavel Luzanov , Erik Wienhold , "pgsql-hackers@postgresql.org" Subject: Re: Psql meta-command conninfo+ Message-ID: <202404011622.eppdne4344lo@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Yeah, that's what I meant about the translations, thanks. Two more comments, - You don't need a two-level conditional here if (pset.sversion >= 90500) { if (pset.sversion < 140000) appendPQExpBuffer(&buf, " ssl.ssl AS \"%s\",\n" " ssl.version AS \"%s\",\n" " ssl.cipher AS \"%s\",\n" " ssl.compression AS \"%s\",\n", _("SSL Connection"), _("SSL Protocol"), _("SSL Cipher"), _("SSL Compression")); if (pset.sversion >= 140000) appendPQExpBuffer(&buf, " ssl.ssl AS \"%s\",\n" " ssl.version AS \"%s\",\n" " ssl.cipher AS \"%s\",\n" " NULL AS \"%s\",\n", _("SSL Connection"), _("SSL Protocol"), _("SSL Cipher"), _("SSL Compression")); } else appendPQExpBuffer(&buf, " NULL AS \"%s\",\n" " NULL AS \"%s\",\n" " NULL AS \"%s\",\n" " NULL AS \"%s\",\n", _("SSL Connection"), _("SSL Protocol"), _("SSL Cipher"), _("SSL Compression")); Instead you can just do something like if (pset.version >= 140000) one thing; else if (pset.version > 90500) second thing; else third thing; This also appears where you add the GSSAPI columns; and it's also in the final part where you append the FROM clause, though it looks a bit different there. - You have three lines to output a semicolon at the end of the query based on version number. Remove the first two, and just have a final one where the semicolon is added unconditionally. - I don't think one for each item in the docs is reasonable. There's too much vertical whitespace in the output. Maybe do this instead: [...] database connection. When + is appended, more details about the connection are displayed in table format: Database: The name of the current database on this connection. Authenticated User: The authenticated user at the time of psql connection with the server. ... - This text is wrong to start with "Returns the": System User: Returns the authentication method and the identity (if any) that the user presented during the authentication cycle before they were assigned a database role. It is represented as auth_method:identity or NULL if the user has not been authenticated. That minor point aside, I disagree with Sami about repeating the docs for system_user() here. I would just say "The authentication data provided for this connection; see the function system_user() for more details." with a link to the appropriate section of the docs. Making us edit this doc if we ever modify the behavior of the function is not great. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "We're here to devour each other alive" (Hobbes)