BUG #13783: 'create database test owner testowner' as 'postgres' leaves test.public owned by postgres

From: xelah-postgresql(at)xelah(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13783: 'create database test owner testowner' as 'postgres' leaves test.public owned by postgres
Date: 2015-11-24 12:12:58
Message-ID: 20151124121258.435.64678@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13783
Logged by: Alex Hayward
Email address: xelah-postgresql(at)xelah(dot)com
PostgreSQL version: 9.4.5
Operating system: Debian 8.2
Description:

'CREATE DATABASE .. OWNER ..' creates a database owned by the correct user,
but containing a schema apparently owned by the user running 'CREATE
DATABASE'. This causes us a problem when our test code tries to 'DROP SCHEMA
public CASCADE' (as a way of clearing the database) as the database owner.

example:

PGHOST=127.0.0.1 psql template1 postgres

Password for user postgres:
psql (9.4.5)
Type "help" for help.
template1=# create user test;
CREATE ROLE
template1=# create database test owner test;
CREATE DATABASE
template1=# \c test
You are now connected to database "test" as user "postgres".
test=# \dn
List of schemas
Name | Owner
--------+----------
public | postgres
(1 row)
test=#

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Glauco Torres 2015-11-24 12:30:41 Re: [BUGS] postgresql downgrade issue
Previous Message Stephen Frost 2015-11-23 21:30:03 Re: BUG #13782: gss auth with libpq does not include realm by default