Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvjxq-0006U5-5d for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Aug 2018 13:59:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fvjxo-0002IV-CM for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Aug 2018 13:59:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvjxo-0002II-5M for pgsql-hackers@lists.postgresql.org; Fri, 31 Aug 2018 13:59:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvjxk-0008Hv-Tl for pgsql-hackers@postgresql.org; Fri, 31 Aug 2018 13:59:51 +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 w7VDxeci017441; Fri, 31 Aug 2018 09:59:40 -0400 From: Tom Lane To: Maksim Milyutin cc: Peter Eisentraut , PostgreSQL-development Subject: Re: Hint to set owner for tablespace directory In-reply-to: <2615ea98-6537-1fcf-667a-09022063336a@postgrespro.ru> References: <5ca60e1a-26f9-89fd-e912-021dd2b8afe2@gmail.com> <1bc2bc14-e42a-8d9c-d47c-3afac05de347@2ndquadrant.com> <2615ea98-6537-1fcf-667a-09022063336a@postgrespro.ru> Comments: In-reply-to Maksim Milyutin message dated "Fri, 31 Aug 2018 15:37:06 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17439.1535723980.1@sss.pgh.pa.us> Date: Fri, 31 Aug 2018 09:59:40 -0400 Message-ID: <17440.1535723980@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Maksim Milyutin writes: > 30.08.2018 19:52, Peter Eisentraut wrote: >> I think the hint is backwards. When you don't have permission to chmod >> the tablespace directory, you probably want to fix the permissions on >> the tablespace directory or its parent. > In this case I propose to: > - replace my initial hint message to the guess what to do if errno == > EPERM, smth like "You might need to install the PostgreSQL system user > as the owner of this directory"; > - add another hint if errno == EACCES: "Fix permissions on the parent > directories". I agree with what I think Peter is saying: the hint should just recommend fixing permissions on the directory, for either errno code. The more detail you try to give, the more likely the hint will be wrong ... especially when you're dealing with errno codes that aren't all that well standardized, as these aren't. regards, tom lane