Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6O5z-0003kw-Hm for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 22:20:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f6O5y-0001Sg-BP for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 22:20:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6O5y-0001SK-0C for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 22:20:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6O5v-0004T2-KO for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 22:20:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w3BMJvEu032316; Wed, 11 Apr 2018 18:19:57 -0400 From: Tom Lane To: Jonathan Leroy - Inikup cc: pgsql-general@lists.postgresql.org Subject: Re: Commands linked to pg_wrapper not working with non-root users In-reply-to: References: Comments: In-reply-to Jonathan Leroy - Inikup message dated "Thu, 12 Apr 2018 00:13:46 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32314.1523485197.1@sss.pgh.pa.us> Date: Wed, 11 Apr 2018 18:19:57 -0400 Message-ID: <32315.1523485197@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jonathan Leroy - Inikup writes: > Here's my issue : when I'm logged as an user which is not root or > postgresql, I can't use any of the commands linked to pg_wrapper: > user1@server1:~ $ /usr/bin/psql --version > Error: Invalid data directory There's no error message with exactly that spelling in PG proper, so it must be coming out of the wrapper script. At a guess, the wrapper script thinks it should be able to examine the data directory, but it can't because of restrictive file permissions. Why your setup is triggering that when it works for other people, I can't say. regards, tom lane