owner of a database does not own "public" schema?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: owner of a database does not own "public" schema?
Date: 2010-06-29 06:20:11
Message-ID: i0c3ar$uci$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I was playing around with schemas and noticed that that the owner of a the database (specified with the CREATE DATABASE command) is not the owner of the database's public schema:

(Connect as super user)

c:\temp>psql postgres postgres
Password for user postgres:
psql (8.4.3)
Type "help" for help.

postgres=# create user foo password 'bar';
CREATE ROLE
postgres=# create database foo owner = foo encoding = 'UTF-8';
CREATE DATABASE
postgres=# \q

c:\>psql foo foo
Password for user foo:
psql (8.4.3)
Type "help" for help.

foo=> drop schema public;
ERROR: must be owner of schema public
foo=>

(As you can see, I'm using Postgres 8.4.3 on Windows)

I understand that I could grant the necessary privileges to the role after creating the database.
I'm just curious why the databse owner is not the owner of the public schema.

Regards
Thomas

Browse pgsql-general by date

  From Date Subject
Next Message Boszormenyi Zoltan 2010-06-29 07:33:25 Dealing with prepared transactions in XactCallback
Previous Message Craig Ringer 2010-06-29 02:41:09 Re: Need xml element constructor given tag, attribute array & children