Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNPS3-0001Ty-Qe for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 21:45:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNPS1-00066B-Ux for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 21:45:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNPS1-00061N-58 for pgsql-general@lists.postgresql.org; Thu, 15 Nov 2018 21:45:25 +0000 Received: from mx1.riseup.net ([198.252.153.129]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNPRi-00050S-Tc for pgsql-general@lists.postgresql.org; Thu, 15 Nov 2018 21:45:23 +0000 Received: from piha.riseup.net (piha-pn.riseup.net [10.0.1.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 4B1541A056A for ; Thu, 15 Nov 2018 13:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1542318305; bh=5JZ0cc0W8356HJ0E/m8T9YKEZBjv0VXGg/lMeBSyb2w=; h=Date:From:To:Subject:References:In-Reply-To:From; b=k0+lK677xIUxkcYzWKJHXUfEikkMf66L8NxoT18ls6dx3KhXxQ0wFwuSKWKEQDAAj 4ddEWyoLeSh0aS308UVTZVQy+Hzky0ulWjGpP6z7cFFZQGtl5S6H+W2f8EtgcHLuwf HHM4SYometXbWmjfo5GWIzEoejBgnjT7zj40j9u4= X-Riseup-User-ID: D79645FCBE7DDE114A9D421B78A8DBB11B0E0DD12AAF8A8B0E63C7EDB6CDB3EF Received: from [127.0.0.1] (localhost [127.0.0.1]) by piha.riseup.net with ESMTPSA id 5A51B1F04CE for ; Thu, 15 Nov 2018 13:45:02 -0800 (PST) Date: Thu, 15 Nov 2018 22:45:00 +0100 From: Nicolas Paris To: pgsql-general@lists.postgresql.org Subject: Re: Default Privilege Table ANY ROLE Message-ID: <20181115214222.3wf4nrub4hhssixk@riseup.net> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <20181114141608.ryvolxl7v7z2grzi@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114141608.ryvolxl7v7z2grzi@riseup.net> Priority: normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Nov 14, 2018 at 03:19:00PM +0100, Nicolas Paris wrote: > Hi > > I d'like my user be able to select on any new table from other users. > > > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner1" IN SCHEMA "myschema" GRANT select ON TABLES TO "myuser" > > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner2" IN SCHEMA "myschema" GRANT select ON TABLES TO "myuser" > > ... > > > Do I really have to repeat the command for all users ? > > The problem is I have many user able to create tables and all of them > have to read each other. > There is apparently no trivial solution, could the Postgres DCL be extended with this syntax in the future ? > ALTER DEFAULT PRIVILEGES FOR ALL ROLE IN SCHEMA "myschema" GRANT select ON TABLES TO "myuser" -- nicolas