Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all

Поиск
Список
Период
Сортировка
От Jeremy Smith
Тема Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all
Дата
Msg-id CAM8SmLX7p7hzBfaHWC8gRvhsTxb6efkoXA-=avEsCzegaZUdvw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-general


I can now characterize what I'd observed more clearly, thus: only a bootstrap super user (as defined above) can start a session without mentioning the name of the database to which to connect and the name of the within-cluster role to connect as—and without supplying a password. And it can do this only from as O/S session where the effective O/S user is the bootstrap superuser.


I don't believe this is correct.  psql is using libpq.  A hint to that is given in the section under the \c command:

When the command neither specifies nor reuses a particular parameter, the libpq default is used.

The libpq docs show more info on the connection parameters (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS)

If not specified, both the user and the dbname default to the name of your operating system user.  So, this could work if your operating system user, the database name, and the database username are all postgres, but they could also all be bob.

As to the password requirement - this depends on the settings in pg_hba.conf.  You could set all connections to trust and then no one would need a password, but I wouldn't recommend that.

  -Jeremy
 
 

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

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all