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

From: Curt Tilmes <curt(at)tilmes(dot)org>
To: 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-03-01 16:36:01
Message-ID: CAMv20O8NjPf=q0bYJuVaTvrG0QOR3rRtOtsSqY4aCOw_0TeCCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 1, 2018 at 3:53 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2018-01-12 09:53:51 -0500, Curt Tilmes wrote:
> > The convention widely adopted for this type of thing is to allow
> > multiple config files to be in a directory, usually the '.d' version of the config filename.
> > What do you think?
>
> Seems like a reasonable idea to me.

Thank you for reviewing!

> 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. I
think most of your comments (crufty, ugly) stem from the existing
code, not the patch. I also
wanted to minimize any impact on the existing well-tested, deployed
code, just adding this
tiny bit of new functionality. I'd rather not rewrite the existing,
working code just to make it
pretty.

Do you have any specific suggestions? Would it help if I separated
the new code into its own
subroutine?

> 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.

> 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?

Thanks,
Curt

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-03-01 16:40:07 Re: change in behaviour for format_type() call
Previous Message Pavel Stehule 2018-03-01 16:15:18 Re: csv format for psql