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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Curt Tilmes <curt(at)tilmes(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Find additional connection service files in pg_service.conf.d directory
Date: 2018-03-01 18:13:40
Message-ID: 20180301181340.lnvozagw2cogljni@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi,

On 2018-03-01 13:04:35 -0500, Curt Tilmes wrote:
>On 2018-03-01 11:36:01 -0500, Curt Tilmes wrote:
>> > This is already pretty crufty, can't we make this look a bit prettier,
>> > rather than extending this approach?
>>
>> My goal was to match the surrounding code style, so I simply copied
>> existing lines.

Yea, I think you're definitely to blame here. But I think just
continuing on the same bad trend isn't a good idea ;)

>> Do you have any specific suggestions? Would it help if I separated
>> the new code into its own
>> subroutine?
>
> I broke the new directory search out into its own subroutine, so even
> less impact on existing code.

I do think that helps!

>> > So there's no really well defined order in which we parse these?
>>
>> These are after the existing homedir/sysconfdir, but yes, once we fall
>> down to the '.d' directory,
>> we just keep trying until we find the specified service, and fail if
>> we never find it.

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?

>> > In my experience with such .conf.d directories it's very useful to
>> > filter names not matching a common pattern. Otherwise you end up with
>> > editor tempfiles and such being used, which gets confusing.
>>
>> Suggestions? I'll make it skip over files prefixed with '.'.
>> Anything else you suggest?
>
> New patch skips over '.' dotfiles.

I'd also insist that the file ending is ".conf".

Thanks for the quick update,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2018-03-01 18:17:24 Re: [HACKERS] Runtime Partition Pruning
Previous Message David Steele 2018-03-01 18:12:19 Re: PATCH: Unlogged tables re-initialization tests