Re: Client application name - Mailing list pgsql-hackers

From Dave Page
Subject Re: Client application name
Date
Msg-id 937d27e10910150846k6093afe3k3031d4b818041f5c@mail.gmail.com
Whole thread Raw
In response to Re: Client application name  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Client application name
List pgsql-hackers
On Thu, Oct 15, 2009 at 4:37 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Another possibility that should be mentioned for the record is that
> we could special-case the appname parameter inside libpq, so that the
> environment variable takes precedence over the conn setting instead
> of the other way round.  That seems pretty ugly too, but maybe it's
> the least bad answer, if we decide that most apps need that precedence.

Looking further, I think this might be quite clean:

- Add a precedence flag to PQconninfoOption

- In conninfo_parse, in the section that grabs the envvars for empty
params, modify the logic to override any existing values if a value is
set in the environment and the precedence flag is set for that option.

That may be useful in the future for other options, and will certainly
be less ugly than special casing one setting.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Client application name
Next
From: Tom Lane
Date:
Subject: Re: Client application name