Superuser accout (PostgreSQL 9.0.4)

Поиск
Список
Период
Сортировка
От Grzegorz Szpetkowski
Тема Superuser accout (PostgreSQL 9.0.4)
Дата
Msg-id BANLkTimo=aKVfZWjsZvE9ZJE6KJB--ofjQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Superuser accout (PostgreSQL 9.0.4)  (Josh Kupershmidt <schmiddy@gmail.com>)
Re: Superuser accout (PostgreSQL 9.0.4)  (Andrej <andrej.groups@gmail.com>)
Список pgsql-novice
Hi,

I have standard main 5432 cluster with postgres owner/superuser. I made:

su -c "su - postgres"
psql -c "\du"
                      List of roles
 Role name |            Attributes             | Member of
-----------+-----------------------------------+-----------
 postgres  | Superuser, Create role, Create DB | {}

psql -c "ALTER ROLE postgres NOSUPERUSER"

After this there is no superuser in cluster 9.0/main, and I can't
restore it to previous point:

psql -c "ALTER ROLE postgres SUPERUSER"
ERROR:  must be superuser to alter superusers

createuser -srd admin
createuser: creation of new role failed: ERROR:  must be superuser to
create superusers

psql -c "UPDATE pg_authid SET rolsuper = true WHERE rolname = 'postgres'"

(rolcatupdate change to false, so obviously above doesn't work)

Is there any way to restore superuser without recreating cluster from
scratch (initdb, pg_createcluster etc.) ? Or better should PostgreSQL
prevent for such situation (mistake command) ? I don't know is there
any "at least one superuser per cluster rule" (?)

Thanks,
Grzegorz Sz.

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

Предыдущее
От: Josh Kupershmidt
Дата:
Сообщение: Re: What does \timing measure?
Следующее
От: Grzegorz Szpetkowski
Дата:
Сообщение: Valid role name (PostgreSQL 9.0.4)