Skip site navigation (1) Skip section navigation (2)

Permission denied to create database

From: Kevin Murphy <murphy2(at)speakeasy(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Permission denied to create database
Date: 2007-05-04 13:06:14
Message-ID: 463B2FC6.6050403@speakeasy.net (view raw or flat)
Thread:
Lists: pgsql-general
Sleep deprived and surely doing something stupid here; I can't seem to 
confer the ability to create databases on a regular user.  I always get 
"permission denied to create database".  One note: template1 has had 
some C functions added to it.  Could that be related to the problem?

$ createdb -U joe joejunkdb
createdb: database creation failed: ERROR:  permission denied to create 
database

$ sudo -u postgres psql -c "grant all on tablespace pg_default to joe"
Password:
GRANT

$ createdb -U joe joejunkdb                                           
createdb: database creation failed: ERROR:  permission denied to create 
database

joe=>  \db+
                                   List of tablespaces
    Name    |  Owner   | Location |           Access 
privileges            | Description
------------+----------+----------+----------------------------------------+-------------
 pg_default | postgres |          | {postgres=C/postgres,joe=C/postgres} |
 pg_global  | postgres |          
|                                        |

joe=> \l+
                            List of databases
   Name    |  Owner   | Encoding | Tablespace |        Description       
-----------+----------+----------+------------+---------------------------
...
template1 | postgres | UTF8     | pg_default | Default template database

For some reason, I haven't succeeded by reading the docs and googling.

Thanks for jarring my memory,
Kevin Murphy
PostgreSQL 8.2.4


Responses

pgsql-general by date

Next:From: Richard HuxtonDate: 2007-05-04 13:15:01
Subject: Re: Permission denied to create database
Previous:From: Michael StoneDate: 2007-05-04 12:45:39
Subject: Re: Feature Request --- was: PostgreSQL Performance Tuning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group