Re: Roles with empty password (probably bug in libpq and in psql as well).

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, pgsql-general(at)postgresql(dot)org
Subject: Re: Roles with empty password (probably bug in libpq and in psql as well).
Date: 2012-07-24 14:36:59
Message-ID: 21538.1343140619@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dmitriy Igrishin <dmitigr(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Wynter 2012-07-24 14:39:52 Problem using a pl/pgsql function to populate a geometry column with x, y data
Previous Message Adrian Klaver 2012-07-24 14:31:57 Re: Roles with empty password (probably bug in libpq and in psql as well).