Postgres processes authentication and authorization separately.
Authentication settings are configured in the file: pg_hba.conf - this file describes what authentication methods users can use and from which hosts they can connect.
Database and table access authorization is configured by issuing GRANT statements in SQL.
On most Linux systems, a Postgres user is configured to use "ident" authentication and does not have a password by default, so if you want to log in using a password, you need to configure it using an SQL statement, and then change your pg_hba.conf to allow postgres users to login with password:
ALTER ROLE postgres WITH PASSWORD password
source share