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 1rBVtH-00BASf-0N for pgsql-general@arkaria.postgresql.org; Fri, 08 Dec 2023 08:07:19 +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 1rBVtF-005fyZ-Mb for pgsql-general@arkaria.postgresql.org; Fri, 08 Dec 2023 08:07:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBVtF-005fwn-Aw for pgsql-general@lists.postgresql.org; Fri, 08 Dec 2023 08:07:17 +0000 Received: from sender-op-o9.zoho.eu ([136.143.169.9]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBVtC-00Ah5x-GV for pgsql-general@lists.postgresql.org; Fri, 08 Dec 2023 08:07:16 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1702022831; cv=none; d=zohomail.eu; s=zohoarc; b=FhnHr6MonnDOYFtT1hYlw/50cWpbVkJJxZHh0/3J3wTPHXUQ8D3dhaeFLLq0XTmQl4fZ4GXsUctXtH0k5YDFX4DLn202AWsn/r3qt1sjuOEdfdoG2A61fAzphNeYFuqJTo+fBEU8Lk7CELuHAh6CNuozRgE3N5xk8dbRe/ISy/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1702022831; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=BRQ3Q6pXjpmgkLJmJmMYigevVrCVygP+QkfExPSc5b8=; b=SrN06kKrxJksTtDaEmNdu+kYaWmJbG1m3ZsrqgbBg7vUbTTjjQ1dhIhZUWUHG2zGjaA6Wr0xJrMZcyB1PiODSqo+GAjHD7+f0fhzMi61wV/wSv/OrA+6A0ZKNvYQ+9L/Bj9OW6gO6q3Lc5HWe1XnSbtYEZJXSEAMwAGYUDGwOBw= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=sedlakovi.org; spf=pass smtp.mailfrom=filip@sedlakovi.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1702022831; s=admin; d=sedlakovi.org; i=filip@sedlakovi.org; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=BRQ3Q6pXjpmgkLJmJmMYigevVrCVygP+QkfExPSc5b8=; b=GHt2EqyV38J0nWpBDYqzsdeuoSXUI1+Wf5Y+bNNfbyEwHaWiQ+TSk0zeTsE8PrPl WkOsp5gRwDgGfEJvC/tUJ4xvV4spKfY/BNy4KkA1aoWgzrMQ6hkVtcLG5UHiCdWzuen z5Etwnmlk6DHtP2QmK3HltHglWCcSIXe2GZcBYeo= Received: from [172.16.0.2] (104.28.238.253 [104.28.238.253]) by mx.zoho.eu with SMTPS id 1702022829201594.8382425752976; Fri, 8 Dec 2023 09:07:09 +0100 (CET) Message-ID: <6a1995fe-a2e5-4c47-8fea-520cd56e6925@sedlakovi.org> Date: Fri, 8 Dec 2023 09:07:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Disable script execution in server level when updating via grids To: arun chirappurath , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Filip Sedlak In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I'd use different users or roles for that - one with more restricted rights. I'm not sure how to do it in your specific client. In general, your user can be granted be granted read-only access and a more powerful role to which it can switch explicitly. mydb=> CREATE TABLE x (id INT); ERROR: permission denied for schema public LINE 1: CREATE TABLE x (id INT); ^ mydb=> SET ROLE powerful; SET mydb=> CREATE TABLE x (id INT); CREATE TABLE In PostgreSQL up to 15, you have to set "NOINHERIT" to your user so you don't automatically get all the privileges on login. In 16, you can set INHERIT FALSE when granting the role. -- Filip Sedlák