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 1hkqtR-0000Sx-PV for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 14:14:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkqtQ-0000oP-Bf for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 14:14:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkqtP-0000mQ-W2 for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 14:14:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkqtN-0007SV-9o for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 14:14:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x69EEiTn015287; Tue, 9 Jul 2019 10:14:44 -0400 From: Tom Lane To: Dave Hughes cc: pgsql-general@lists.postgresql.org Subject: Re: SuperUser permission denied when creating table. In-reply-to: References: Comments: In-reply-to Dave Hughes message dated "Tue, 09 Jul 2019 08:31:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15285.1562681684.1@sss.pgh.pa.us> Date: Tue, 09 Jul 2019 10:14:44 -0400 Message-ID: <15286.1562681684@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dave Hughes writes: > I recently noticed that my default superuser "postgres" cannot create > tables in new schemas I create, but can in some existing ones. > So as the postgres user I ran: > afleads=# create schema mytest; > CREATE SCHEMA > afleads=# create table mytest.test (col1 int); > ERROR: permission denied for schema mytest > LINE 1: create table mytest.test (col1 int); I think you're shooting yourself in the foot with those event triggers, ie trg_create_table is switching the role to something that lacks permissions to do the CREATE. regards, tom lane