[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Podstawy PostgreSQL 8



Cześć,

Kolejna próba :)

--------------------------------------------------------------
# passwd postgres
New UNIX password:
Retype new UNIX password:
passwd: hasło zostało zmienione
#

su postgres

$ psql
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=#\du


                               List of roles
 Role name  | Superuser | Create role | Create DB | Connections | Member of
------------+-----------+-------------+-----------+-------------+-----------
 postgres   | yes       | yes         | yes       | no limit    |

--------------------------------------------------------------


Teraz na innej konsoli (jako użytkownik postgres):

--------------------------------------------------------------
$su postgres

$ createuser
Enter name of role to add: psql_admin
Shall the new role be a superuser? (y/n) y
CREATE ROLE
--------------------------------------------------------------

I znów powrót na pierwszą:

--------------------------------------------------------------
postgres=# \du
                               List of roles
 Role name  | Superuser | Create role | Create DB | Connections | Member of
------------+-----------+-------------+-----------+-------------+-----------
 postgres   | yes       | yes         | yes       | no limit    |
 psql_admin | yes       | yes         | yes       | no limit    |
--------------------------------------------------------------

Ok czyli mam dwóch adminów, ale dalej żaden nie może się  podłączyć (próbuje
się łączyć ze zwykłego konta, zwykłego użytkownika systemowego):

--------------------------------------------------------------
$ psql -h localhost -U postgres -W
Password for user postgres:
psql: FATAL:  password authentication failed for user "postgres"

$ psql -h localhost -U psql_admin -W
Password for user psql_admin:
psql: FATAL:  password authentication failed for user "psql_admin"

Dodam ze /etc/passwd jes tylko użytkownik postges
--------------------------------------------------------------

Jedyny udany sposób to przełączenie sie na użytkownika postgres przez su i
wtedy, ale o co chodzi że nie łączy sie z innego konta:

$ psql -h localhost -U postgres -W
$ psql -h localhost -U psql_admin -W

Dzięki

--
Pozdrawiam


Reply to: