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 1sk2RH-006zuT-69 for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2024 14:17:23 +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 1sk2RD-0057qF-Dq for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2024 14:17:19 +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 1sk2RD-0057q5-2g for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2024 14:17:19 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:510a::3]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sk2RA-002BXx-Cw for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2024 14:17:18 +0000 Received: from sciurus.exwg.net (unknown [IPv6:2001:470:7120:1:826d:97ff:fe4b:c7af]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sciurus.exwg.net", Issuer "R11" (verified OK)) by smtp.burggraben.net (Postfix) with ESMTPS id 59F40C0030C; Fri, 30 Aug 2024 16:17:12 +0200 (CEST) Received: by sciurus.exwg.net (Postfix, from userid 1000) id 122634354916; Fri, 30 Aug 2024 14:49:01 +0200 (CEST) Date: Fri, 30 Aug 2024 14:49:01 +0200 From: Christoph Moench-Tegeder To: Atul Kumar Cc: pgsql-general Subject: Re: default privileges are npt working Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## Atul Kumar (akumar14871@gmail.com): > Then I granted default "select" privileges to reader *user *to read data of > all tables created by writer *user* using below command: > > alter default privileges in schema grant select on tables > to . "ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the future. (It does not affect privileges assigned to already-existing objects.)" That's the first two sentences from https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html If you want to grant/revoke access on existing objects, use plain old GRANT/REVOKE: https://www.postgresql.org/docs/current/sql-grant.html Regards, Christoph -- Spare Space.