Re: Roles with empty password (probably bug in libpq and in psql as well). - Mailing list pgsql-general

From Tom Lane
Subject Re: Roles with empty password (probably bug in libpq and in psql as well).
Date
Msg-id 21538.1343140619@sss.pgh.pa.us
Whole thread Raw
In response to Re: Roles with empty password (probably bug in libpq and in psql as well).  (Dmitriy Igrishin <dmitigr@gmail.com>)
Responses Re: Roles with empty password (probably bug in libpq and in psql as well).  (Dmitriy Igrishin <dmitigr@gmail.com>)
List pgsql-general
Dmitriy Igrishin <dmitigr@gmail.com> writes:
> But it's impossible to pass empty (NULL) password to the backend

Please note that empty and null are not the same thing...

> by using libpq, because connectOptions2() defined the
> fe-connect.c reads a password from the ~/.pgpass even when a password
> specified as an empty string literal ("").

I rather doubt that we'll change this, because it seems more likely
to break applications that rely on that behavior than to do anything
useful.  Surely nobody in their right mind uses an empty password.

(If anything, I'd be more inclined to make the backend treat an empty
password as an error than to try to make libpq safe for the case.
Even if we did change libpq, there are probably issues with empty
passwords in jdbc and who knows how many other places.)

            regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Roles with empty password (probably bug in libpq and in psql as well).
Next
From: Tom Lane
Date:
Subject: Re: Odd corruption issue reported on dba.stackexchange.com, need advice