Re: Re: [COMMITTERS] pgsql: libpq: change PQconndefaults() to ignore invalid service files

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: libpq: change PQconndefaults() to ignore invalid service files
Date: 2014-03-20 15:49:05
Message-ID: 20140320154905.GC7711@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sat, Mar 8, 2014 at 08:44:34PM -0500, Bruce Momjian wrote:
> [Just getting back to this.]
>
> Agreed. I have developed the attached patch which passes the strdup()
> failure up from pg_fe_getauthname() and maps the failure to
> PQconndefaults(), which is now documented as being memory allocation
> failure.
>
> FYI, there was odd coding in PQconndefaults() where we set local
> variable 'name' to NULL, then we tested to see if it was NULL --- I
> removed that test.
>
> > idea that we're ignoring failure returns from pqGetpwuid/GetUserName?
>
> If we want pqGetpwuid/GetUserName to be a special return value, we would
> need to modify PQconndefaults()'s API, which doesn't seem worth it.

Applied. I added a C comment about why we ignore pqGetpwuid/GetUserName
failures.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-03-20 16:58:42 pgsql: Again fix initialization of auto-tuned effective_cache_size.
Previous Message Bruce Momjian 2014-03-20 15:48:37 pgsql: libpq: pass a memory allocation failure error up to PQconndefau

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-03-20 16:29:51 Re: Risk Estimation WAS: Planner hints in Postgresql
Previous Message Tom Lane 2014-03-20 15:35:40 Re: effective_cache_size cannot be changed by a reload