Re: Why can't the database owner create schemas and how can I enable that?

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why can't the database owner create schemas and how can I enable that?
Date: 2017-09-23 06:33:54
Message-ID: c7914052-d496-7177-0d48-b4850c8d1597@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/22/2017 10:29 PM, Tim Uckun wrote:
> I am setting up a database for an app. So I create a user without
> superuser but with login priveleges
>
> I then create a database and set it's owner to that user like this...
>
> dropdb --if-exists api_development
> dropuser --if-exists api_user
>
> createuser api_user -P -d
> createdb api_development -O api_user
>
> The app can now connect to the database but it can't create any
> tables, schemas or anything else unless I give it superuser privileges.
>
> Is there any way I can make this user a superuser for this database
> without making it a superuser on other databases?

that should have worked just fine.

[root(at)new ~]# useradd fred
[root(at)new ~]# su - postgres
$ createuser fred
$ createdb fred -O fred
$ logout
[root(at)new ~]# su - fred
[fred(at)new ~]$ psql
psql (9.3.19)
Type "help" for help.

fred=> create schema xyzzy;
CREATE SCHEMA
fred=> create table xyzzy.abc (id serial, dat text);
CREATE TABLE
fred=> \q

.....

--
john r pierce, recycling bits in santa cruz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Job 2017-09-23 08:44:22 Adding Cyrillic support
Previous Message Vladimir Mihailenco 2017-09-23 06:18:50 shared_buffers smaller than max_wal_size