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 1oxWb3-0001Q0-AO for pgsql-general@arkaria.postgresql.org; Tue, 22 Nov 2022 16:58:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxWb2-0001Ht-5n for pgsql-general@arkaria.postgresql.org; Tue, 22 Nov 2022 16:58:08 +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 1oxWb0-0001Hj-OU for pgsql-general@lists.postgresql.org; Tue, 22 Nov 2022 16:58:07 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxWaw-0004Pt-HN for pgsql-general@postgresql.org; Tue, 22 Nov 2022 16:58:06 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B14F85C028D; Tue, 22 Nov 2022 11:57:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 22 Nov 2022 11:57:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1669136278; x= 1669222678; bh=EqGoQ36m9er4eZVSWmas/Tx4CeyCO8+2uDMKy3L6RjE=; b=f mItRKcLwn5x9nq/hwf0WJtzzLfhLcCx/1ZK2U7u76i8AwIBj+GTZx1z3iIP0pgpu G2RblF/bWekPF0UADQqtpxSdkVtlr1y8HG8S+A2JGg5e8XbfW0wHrJK4PK5PB3Iz Yi0s8Z/3qf9/jHtKUHk95YYu4RO5FA+VcuzH7q4c2QFOV0ddt63hhMYTDMWUYpmH jip49LheQfk61VH6LAYBuPH1AUJNWnNyZBkfC7mBEUzmbTB4qtuMbDx6bLj0lx8O Zys/PBgw6Tbhc3J8QPIQzwYFEwnzccTutcab0F0vE5dSxIKb45dD3BdxowQdIfpl uohgBRvFz4+akljknuwgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1669136278; x=1669222678; bh=E qGoQ36m9er4eZVSWmas/Tx4CeyCO8+2uDMKy3L6RjE=; b=BvlyidJH6MB9Hwcs2 gAGrnNPe+3AmOifJL9JHXA7Z7xa8di5y+aA7AIbeypcJMWMcUrT5i0kSioDfT/ee IsKPLrvNlX+K+3L+jIZfAC2Ci7NtTI52osh6H8mybhU2dDtbC639AJEyV2X3Szfu p7xA7rIRCZ58Y/yZqZPz4iZMJvRlNqPRhNGhM1tgM7JJe7FC6iFhKU45nGKdjfBe pbrteIPeUWfpW5ipHyOFvqTh6pPaWzyfw70/+a30Lz9vPiECNGoeg97+u9FQiQh/ BxgHpaaq8zG2Pp0IaPTein5AnDp70SMvTEqmjS3iXVpbQwFHxnQw5ZNJ/8eswpcQ JAbMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrheelgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeffudehtdduge fgkeevudffheevvefhfeettdfhveeivdfgieeghfeiueeggffggeenucffohhmrghinhep phhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtgho mh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Nov 2022 11:57:57 -0500 (EST) Message-ID: Date: Tue, 22 Nov 2022 08:57:57 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: system variable can be edited by all user? Content-Language: en-US To: chris navarroza , pgsql-general@postgresql.org References: From: Adrian Klaver In-Reply-To: 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 11/21/22 22:25, chris navarroza wrote: > Hi, > > Ive created a read only user (SELECT PRIVILEGE) but it turns out that > this user can do this queries: SHOW work_mem; SET work_mem='40MB'; How > do I limit him? Short answer is what Laurenz Albe posted. Long answer is: From: https://www.postgresql.org/docs/current/view-pg-settings.html select name, setting, context from pg_settings where name = 'work_mem'; name | setting | context ----------+---------+--------- work_mem | 4096 | user user These settings can be set from postgresql.conf, or within a session via the SET command. Any user is allowed to change their session-local value. Changes in postgresql.conf will affect existing sessions only if no session-local value has been established with SET. See page for the other possible values for context and what they mean with regard to privileges. > > Thanks, > > Butching > -- Adrian Klaver adrian.klaver@aklaver.com