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.92) (envelope-from ) id 1jAAmr-0003zm-73 for pgsql-general@arkaria.postgresql.org; Fri, 06 Mar 2020 11:05:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jAAmq-0007tz-1P for pgsql-general@arkaria.postgresql.org; Fri, 06 Mar 2020 11:05:00 +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 1jAAmp-0007tp-L0 for pgsql-general@lists.postgresql.org; Fri, 06 Mar 2020 11:04:59 +0000 Received: from out-mail.so.ch ([193.135.75.103] helo=in-mail1.so.ch) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAAml-0000yt-Qa for pgsql-general@lists.postgresql.org; Fri, 06 Mar 2020 11:04:58 +0000 From: Schmid Andreas To: "'pgsql-general@lists.postgresql.org'" Subject: How to allow users to create and modify tables only in their own schemas, but with generic table owner Thread-Topic: How to allow users to create and modify tables only in their own schemas, but with generic table owner Thread-Index: AdXzpw5aCP99oMIPRTCalQ4h7PU6xA== Date: Fri, 6 Mar 2020 11:04:50 +0000 Message-ID: <523af9d43b78454882a270b0839fe5c1@bd.so.ch> Accept-Language: de-CH, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.36.8.5] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-FEAS-DICTIONARY: 1(X-processed-by-seppmail:from:1) X-FEAS-CONTENT-MODIFICATION: X-SM-outgoing: yes X-processed-by-seppmail: fromSEPPmail List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi List I'd like to setup my database in a way that only a superuser may create sch= emas, then grants permission to a specific user to create tables inside thi= s schema. This should work so far with GRANT CREATE ON SCHEMA ... TO user_a= . However I want the table owner not to be the user that creates the tables= . Instead the owner should rather be a generic role (e.g. table_owner), and= the owner should be the same over all tables of the whole database. This w= ould work, too, if I grant membership in role table_owner to all users that= may create tables. (The users must issue a SET ROLE table_owner before cre= ating tables.) What I didn't achieve so far is making sure that user_a who created tables = in schema_a cannot crete/modify tables of schema_b that were created by use= r_b. Do you see any way to achieve this, while still sticking to that gener= ic owner role? Thanks a lot for your thoughts. Andy