db user named 'root'

Поиск
Список
Период
Сортировка
От Atul Shah
Тема db user named 'root'
Дата
Msg-id F062093E456F8C4A9566C5CA59726C6E04F94695@EMAIL.hci.utah.edu
обсуждение исходный текст
Ответы Re: db user named 'root'  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin

Hello,

I have recently installed postgresql on a x486 box running debian linux, as a prelude to installing an open source bioinformatics system called the longhorn array database (lad).  The lad install requires you to create a postgres user named 'root' with create priveleges, in order to run an install script (which presumably creates a database as owner root).  I am able to create a db user named 'root', but get an error when trying to create a db as root.

 

As postgres (db superuser):

createuser -s  -d root

 

CREATE ROLE

 

su root

createdb root_db

 

createdb: could not connect to database template1: FATAL:  user "root" does not exist

 

psql

 

psql: FATAL:  database "root" does not exist

 

 

But the user root exists in the system:

As postgres:

psql

 

                               List of roles

 Role name | Superuser | Create role | Create DB | Connections | Member of

-----------+-----------+-------------+-----------+-------------+-----------

 atul      | yes       | yes         | yes       | no limit    |

 postgres  | yes       | yes         | yes       | no limit    |

 root      | yes       | yes         | yes       | no limit    |

(3 rows)

 

This shows that root is registered as a db user.

Also, postgres can create a database for root:

As postgres:

createdb -O root root_db

 

CREATE DATABASE

 

A database was successfully created with owner 'root':

As postgres:

psql -l

 

        List of databases

   Name    |  Owner   | Encoding

-----------+----------+-----------

 atul      | atul     | SQL_ASCII

 postgres  | postgres | SQL_ASCII

 root_db   | root     | SQL_ASCII

 template0 | postgres | SQL_ASCII

 template1 | postgres | SQL_ASCII

(5 rows)

 

But root cannot access it—in fact postgres says the database does not exist!

As postgres:

su root

psql root_db

 

psql: FATAL: database “root_db” does not exist!

 

Can anyone tell what's going on here?  Why won't postgres allow root to createdb himself, or to use psql?

Thanks in advance for your help!

 

Atul

 

 

 

 

 

 

Huntsman Cancer Institute wishes to promote open communication while protecting confidential and/or privileged information.  If you have received this message in error, please inform the sender and delete all copies.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: auth methods
Следующее
От: Tom Lane
Дата:
Сообщение: Re: db user named 'root'