Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU10q-0004Qc-HN for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 07:55:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pU10n-0000Kr-8V for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 07:55:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU10m-0000KW-E0 for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 07:55:00 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU10f-0008Pp-4u for pgsql-hackers@postgresql.org; Mon, 20 Feb 2023 07:54:59 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 27A0C58204F; Mon, 20 Feb 2023 02:54:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 20 Feb 2023 02:54:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1676879691; x= 1676886891; bh=T2fjUcZYTsvwFpU0fcX6XBtXMtwzt3ZJKRmEg4n9XGQ=; b=T 8vng6qQrPTAAGRXgmM8w5BFzal7u/xCEvJ3K2L1KKxTVEQUFK+aUwDTt2AggyFz1 D1P1jj1f9yemuUojGGzqshGVdhmNVDz4olxxtUQAuHzzYy2/pysXd7yvikJu6Imt fypRxRjQx0yihZtl0Wzd4+jXewlXj27tpFJHRcT2dOLTK7+41DzwQzQX9wUNb0mo zSPfa4MNUk8zAbrCuE9Fuv29064XmNJTVg80L9bRl784+78hYyRcmdCVh0EHZGDN 5VWJJeOBK3w+r3r3uViMgrS7OZ3qgyapmmcz+XuwoyoVk+cRjG7apwuAtKspYkRV HKeHpgbgOhGacQAbZpQBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejgedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnh htvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepheelffeggedujeet iefhleetuddvieffhfffvdejvdffgeejkeduleduheduieefnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgr uhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Feb 2023 02:54:49 -0500 (EST) Message-ID: Date: Mon, 20 Feb 2023 08:54:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: improving user.c error messages Content-Language: en-US To: Nathan Bossart , Alvaro Herrera Cc: Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" References: <20230127000936.GA1998073@nathanxps13> <20230127183119.e5jtyh4g2md57ctb@alvherre.pgsql> <20230127231507.GA2221340@nathanxps13> <20230207201009.GA450353@nathanxps13> From: Peter Eisentraut In-Reply-To: <20230207201009.GA450353@nathanxps13> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07.02.23 21:10, Nathan Bossart wrote: >> ERROR: permission denied to use replication slots >> DETAIL: You must have REPLICATION privilege. >> >> adding the operation to the end seems less awkward (i.e., "You must have >> REPLICATION privilege to use replication slots."). I don't think there's >> any information lost by omitting the action in the DETAIL, so perhaps this >> is just a stylistic choice. I think I'm inclined to add the action to the >> DETAIL whenever it doesn't make the message lengthy and awkward, and leave >> it out otherwise. Thoughts? > Here is a new patch set with this change and some other light editing. I'm concerned about the loose use of "privilege" here. A privilege is something I can grant. So if someone doesn't have the "REPLICATION privilege", as in the above example, I would expect to be able to do "GRANT REPLICATION TO someuser". Since that is not what is happening, we should use some other term. The documentation around CREATE USER uses the terms "attribute" and "option" (and also "privilege") for these things. Similarly -- this is an existing issue but we might as well look at it -- in something like must be superuser or a role with privileges of the pg_write_server_files role the phrase "a role with the privileges of that other role" seems ambiguous. Doesn't it really mean you must be a member of that role? I also feel that in sentences like "You must have %s privilege to create roles." a "the" is missing.