Re: SuperUser permission denied when creating table.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Hughes <dhughes20(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: SuperUser permission denied when creating table.
Date: 2019-07-09 14:14:44
Message-ID: 15286.1562681684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dave Hughes <dhughes20(at)gmail(dot)com> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igal @ Lucee.org 2019-07-09 14:41:37 Re: pg_dump and search_path
Previous Message Adrian Klaver 2019-07-09 14:12:13 Re: pg_dump and search_path