Login into PostgreSQL without password

From: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Login into PostgreSQL without password
Date: 2016-05-26 13:21:26
Message-ID: CAKKotZRGMdH3omD3GdW3LwA-AYbm4qY3+BKpXpfQMj9LDsFvtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have created a role using below sql, then I disconnected & try to login
into postgres db with newly created user "test_role", It prompt for
password and I pressed Enter key because I did not provided any password
when I created role so it throw me an error as below *Error: fe_sendauth:
no password supplied.*

Can someone please explain this behaviour of postgreSQL database, where I'm
not allowed to login without password even if I do not have password set
for "test_role" user?

The work around is I had to manually edit pg_hba conf and change
authentication method to trust for this user so that i can login without
password.

And If that's how postgreSQL authentication works, then can we add a
mechanism to disallow user to create role without password if running with
md5 authentication mode?

*SQL Query used to create role:*

CREATE USER test_role WITH
LOGIN
SUPERUSER
CREATEDB
CREATEROLE
INHERIT
REPLICATION
CONNECTION LIMIT -1;

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2016-05-26 13:26:28 Re: Login into PostgreSQL without password
Previous Message Nikolay Shaplov 2016-05-26 12:29:44 Re: [PROPOSAL] Move all am-related reloption code into src/backend/access/[am-name] and get rid of relopt_kind