pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Joao Miguel Ferreira <joao.miguel.c.ferreira@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: permission denied to create and drop user
Date: Tue, 2 Feb 2021 14:27:56 -0800
Message-ID: <0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com> (raw)
In-Reply-To: <CALyyT7Rd1KB=KhO=HKcpyvXVC9Qy9uKRzfAbcv3Z4E7cuBTJHg@mail.gmail.com>
References: <CALyyT7Rd1KB=KhO=HKcpyvXVC9Qy9uKRzfAbcv3Z4E7cuBTJHg@mail.gmail.com>

On 2/2/21 1:58 PM, Joao Miguel Ferreira wrote:
> Hello all,
> 
> I have just installed postgresql on Debian stable (from debian apt 
> archives). It seems that the postgres user does not have permissions to 
> DROP/CREATE USER. I was expecting the postgres user to be a superuser 
> but something seems weird. my postgres user does not have the usual 
> superuser attributes.
> 
> Please see my results bellow:
> 
> root@deb10tp:/# id
> uid=0(root) gid=0(root) groups=0(root)
> root@deb10tp:/# pwd
> /
> root@deb10tp:/# su postgres
> postgres@deb10tp:/$ psql
> psql (11.9 (Debian 11.9-0+deb10u1))
> Type "help" for help.

Not sure how you can do above when below the postgres user does not have 
LOGIN attribute?

What where the exact steps you took when you did the install?

> 
> postgres=> DROP USER foo;
> ERROR:  permission denied to drop role
> postgres=> DROP USER postgres;
> ERROR:  permission denied to drop role
> postgres=> CREATE USER foo;
> ERROR:  permission denied to create role
> postgres=> \du
>             List of roles
>   Role name | Attributes | Member of
> -----------+------------+-----------
>   pgcon     |            | {}
>   postgres  |            | {}
> 
> How do I get a superuser/postgres that is capable to CREATE / DROP 
> another user? or a user that might allowed to do anything?
> 
> Thank you
> Joao
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (5+ messages)  latest in thread

Message-ID: <0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com>
Permalink:  ../0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com/
Also on:    postgresql.org/message-id/0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com

 · 

reply

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: adrian.klaver@aklaver.com, joao.miguel.c.ferreira@gmail.com
  Subject: Re: permission denied to create and drop user
  In-Reply-To: <0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com>
  References: <CALyyT7Rd1KB=KhO=HKcpyvXVC9Qy9uKRzfAbcv3Z4E7cuBTJHg@mail.gmail.com> <0f563274-5f45-85aa-69a8-1d3440329bc1@aklaver.com>

* 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