4 ms·
Postgres auth is intertwined? I mean, yeah, to create the first database and set of users, the local user must be in the postgres group. But after that (or if y
by ttfkam 5y ago
Postgres auth is intertwined? I mean, yeah, to create the first database and set of users, the local user must be in the postgres group. But after that (or if you edit the pg_hba.conf file)?
https://www.postgresql.org/docs/current/auth-pg-hba-conf.html https://www.postgresql.org/docs/current/auth-pg-hba-conf.htm...
It uses the current OS user as the default user to connect with. What else would you default to? But you can (and 99% of the time should) specify the role you're connecting with, which is a purely database-controlled role, not an OS username.
Honestly I never thought MySQL's method was clearer, but I acknowledge that's subjective. That said, MySQL's solution for a VERY long time in its history was simply to default to superuser/root within the database until you lock it down.
"Simple" turned out to be a security nightmare for a lot of folks who didn't realize what was happening, which was almost all new users.
But that's mostly moot for most folks now. Managed database instances in Azure, GCloud, AWS, DigitalOcean, et al is rapidly becoming the norm (if it isn't already). In those environments, the connectivity options are really hard to distinguish between Postgres and MySQL.