Re: [PATCH] Find additional connection service files in pg_service.conf.d directory

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Curt Tilmes <curt(at)tilmes(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Find additional connection service files in pg_service.conf.d directory
Date: 2018-07-19 09:38:58
Message-ID: 48a7c7a2-cb6f-faab-e59e-359ac7750dfb@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Handy feature!

On 01/03/18 20:40, Curt Tilmes wrote:
> On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> And within the directory which service file wins will be decided by
>> filesystem internals. That makes me a bit uncomfortable, this very well
>> might not be stable. I think it might not be terrible idea to sort the
>> directory and process alphabetically?
>
> My preference would be not to do this. I added a note to the doc about
> this.

I also think we should process the files in alphabetical order. That's
how most software with conf.d directories work.

Imagine that you place "good.conf" and "bad.conf" in the config dir, and
they both accidentally contain a service called "foobar". Everything
seems to work fine, because the filesystem happens to return good.conf
first. Then you take a backup of your system with "tar", and restore it
on another system. On that system, "bad.conf" happens to be returned
first, and it doesn't work. That's nightmare to debug.

Should we also search ~/.pg_service.conf.d ? And a PGSERVICEDIR env
variable, to mirror PGSERVICEFILE. I don't think many people would use
those, but I feel like it would be good to have consistency, so that
wherever we search for "pg_service.conf" file, we also search for
"pg_service.conf.d" directory.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mai Peng 2018-07-19 10:20:18 Re: Segfault logical replication PG 10.4
Previous Message Masahiko Sawada 2018-07-19 09:38:00 Re: print_path is missing GatherMerge and CustomScan support