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

From: Jeremy Smith <jeremy(at)musicsmith(dot)net>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: Ian Lawrence Barwick <barwick(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all
Date: 2022-10-27 20:41:22
Message-ID: CAM8SmLX7p7hzBfaHWC8gRvhsTxb6efkoXA-=avEsCzegaZUdvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-10-27 22:24:06 Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all
Previous Message Bryn Llewellyn 2022-10-27 20:14:58 Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all