Permission denied to create database

Поиск
Список
Период
Сортировка
Искать

Permission denied to create database

От:
Kevin Murphy <murphy2@speakeasy.net>
Дата:
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

Re: Permission denied to create database

От:
Richard Huxton <dev@archonet.com>
Дата:
Kevin Murphy wrote:
> 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

As a superuser: ALTER USER joe CREATEDB

Then go get some sleep :-)

-- 
   Richard Huxton
   Archonet Ltd

Re: Permission denied to create database

От:
"Ashish Karalkar" <ashish.karalkar@info-spectrum.com>
Дата:
Can u tell us what are the role privilages granted to user "joe"
May be you r missing with the create database privilage to user joe


With Regards
Ashish....

----- Original Message ----- 
From: "Kevin Murphy" 
To: 
Sent: Friday, May 04, 2007 6:36 PM
Subject: [GENERAL] Permission denied to create database


> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org/ 

Re: Permission denied to create database

От:
"Mikko Partio" <dun@haisuli.net>
Дата:

>
> $ 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
>

How about ALTER ROLE joe CREATEDB

Regards

MP

Re: Permission denied to create database

От:
Kevin Murphy <murphy@genome.chop.edu>
Дата:
Richard Huxton wrote:
> Kevin Murphy wrote:
>> Sleep deprived and surely doing something stupid here; I can't seem 
>> to confer the ability to create databases on a regular user.
> As a superuser: ALTER USER joe CREATEDB
Thanks, Richard and others who replied.  I don't have to deal with 
permissions very often.

-Kevin


FAQ