From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Hughes <dhughes20@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: SuperUser permission denied when creating table.
Date: Tue, 09 Jul 2019 10:14:44 -0400
Message-ID: <15286.1562681684@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFTBbFAML_FWxMH4iLbRZ80v5NCHoUtpYn-yfmbtEEk899s0+g@mail.gmail.com>
References: <CAFTBbFAML_FWxMH4iLbRZ80v5NCHoUtpYn-yfmbtEEk899s0+g@mail.gmail.com>
Dave Hughes <dhughes20@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, dhughes20@gmail.com
Subject: Re: SuperUser permission denied when creating table.
In-Reply-To: <15286.1562681684@sss.pgh.pa.us>
References: <CAFTBbFAML_FWxMH4iLbRZ80v5NCHoUtpYn-yfmbtEEk899s0+g@mail.gmail.com> <15286.1562681684@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox