pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-admin@postgresql.org
Subject: Re: cannot remove schema public
Date: Mon, 07 Jul 2014 12:19:55 +0200
Message-ID: <lpds8b$h7e$1@ger.gmane.org> (raw)
In-Reply-To: <CAFjNrYu8GqD=17DimG9QtWoV1hPviqHxaZp2umWAPkpUOFAGYg@mail.gmail.com>
References: <CAFjNrYu8GqD=17DimG9QtWoV1hPviqHxaZp2umWAPkpUOFAGYg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Szymon Guz, 07.07.2014 11:57:
> For the schema public I want to remove it and create again. 
> However that doesn't work, I'm wondering if that's on purpose, or it's a kind of a bug.
> 
> I'm using user 'szymon' in my console.
> 
> Then I created a user:
> 
> create user test password 'test';
> 
> and database
> 
> create database test owner test;
> 
> I logged into the database as the user:
> 
> test=# \c test test
> You are now connected to database "test" as user "test".
> 
> And the owner of the public schema is not test, however it's an owner of the test database.
> 
> test=# \dn
>  List of schemas
>   Name  | Owner 
> --------+--------
>  public | szymon
> (1 row)
> 
> When I try to remove the public schema, then I get:
> 
> test=> drop schema public cascade;
> ERROR:  must be owner of schema public

I noticed that as well recently. 
I think there is not much you can do apart from changing the ownership of the schema after creating the database.

However: I use "drop owned by test" to be better suited to make a clean database for testing purposes. 
This also means any extension that was installed into the database (and which is not owned by the test user) will survive this as well.





-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <lpds8b$h7e$1@ger.gmane.org>
Permalink:  ../lpds8b$h7e$1@ger.gmane.org/
Also on:    postgresql.org/message-id/lpds8b$h7e$1@ger.gmane.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: cannot remove schema public
  In-Reply-To: <lpds8b$h7e$1@ger.gmane.org>

* 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