On Mon, Jun 18, 2018 at 12:17 PM Arthur Zakirov <a.zaki...@postgrespro.ru> 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 is denied to open the directory.
Correct. The patch follows the model of the existing code. It keeps looking for the correct service until it either finds it or doesn't. If you want to temporarily hide your pg_service.conf.d directory or files by removing permissions, it will work fine, correctly skipping over them. That is not considered an error. If there is a real syntax error in the file, just as for the other files, that will be reported as a syntax error. If after looking in all the right places it doesn't find the service, it will correctly report that the service was not found. Curt