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

2018-09-30 Thread Michael Paquier
On Mon, Aug 06, 2018 at 11:20:31AM -0400, Curt Tilmes wrote: > On Thu, Jul 19, 2018 at 5:39 AM Heikki Linnakangas wrote: >> I also think we should process the files in alphabetical order. That's >> how most software with conf.d directories work. >> > > In my experience, this is not a problem with

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

2018-08-06 Thread Curt Tilmes
On Thu, Jul 19, 2018 at 5:39 AM Heikki Linnakangas wrote: > Handy feature! > > On 01/03/18 20:40, Curt Tilmes wrote: > > On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund > wrote: > >> And within the directory which service file wins will be decided by > >> filesystem internals. That makes me a bit

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

2018-07-19 Thread Heikki Linnakangas
Handy feature! On 01/03/18 20:40, Curt Tilmes wrote: On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund 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 te

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

2018-07-05 Thread Curt Tilmes
On Mon, Jun 18, 2018 at 12:17 PM Arthur Zakirov wrote: > I think when some error occured in searchServiceFileDirectory() then the > error "definition of service \"%s\" not found" will be raised, because > group_found is false. It may confuse as it hides a real error. For > example, if permission i

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

2018-06-18 Thread Michael Paquier
On Mon, Jun 18, 2018 at 07:17:14PM +0300, Arthur Zakirov wrote: > Isn't it worth to check errno for stat(), opendir() and readdir() > calls? Checking for such errors is mandatory. There are some cases where there are filters based on errno like ENOENT, but if something unexpected is happening the

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

2018-06-18 Thread Arthur Zakirov
Hello, On Thu, Mar 01, 2018 at 01:40:10PM -0500, Curt Tilmes wrote: > New patch limits files to ".conf". Isn't it worth to check errno for stat(), opendir() and readdir() calls? I think when some error occured in searchServiceFileDirectory() then the error "definition of service \"%s\" not found

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

2018-03-05 Thread Curt Tilmes
On Mon, Mar 5, 2018 at 7:45 AM, Andreas 'ads' Scherbaum wrote: > On Thu, Mar 1, 2018 at 7:40 PM, Curt Tilmes wrote: >> On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund wrote: > Looked over this patch and found that you limit the directory entries to > files only. > Would it make sense to allow link

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

2018-03-05 Thread Andreas 'ads' Scherbaum
On Thu, Mar 1, 2018 at 7:40 PM, Curt Tilmes wrote: > On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund wrote: > > > I'd also insist that the file ending is ".conf". > > New patch limits files to ".conf". > Looked over this patch and found that you limit the directory entries to files only. Would

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

2018-03-01 Thread Curt Tilmes
On Thu, Mar 1, 2018 at 1:13 PM, Andres Freund 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 alp

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

2018-03-01 Thread Andres Freund
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 >

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

2018-03-01 Thread Curt Tilmes
On Thu, Mar 1, 2018 at 11:36 AM, Curt Tilmes wrote: > 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. >> In my experience with such .con

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

2018-03-01 Thread Curt Tilmes
On Thu, Mar 1, 2018 at 3:53 AM, Andres Freund 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

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

2018-03-01 Thread Andres Freund
Hi, On 2018-01-12 09:53:51 -0500, Curt Tilmes wrote: > I love centralizing connection service definitions in > /pg_service.conf, but for a > large enterprise, sometimes we have multiple sets of connection > service definitions > independently managed. > > The convention widely adopted for this ty

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

2018-01-14 Thread Michael Paquier
On Fri, Jan 12, 2018 at 09:53:51AM -0500, Curt Tilmes wrote: > This patch adds an extra search for service connection definitions if > the current places fail > to find the service (~/.pg_service.conf /pg_service.conf). > It will then search > every readable file in the directory /pg_service.conf.d