Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVOFu-0003Dk-00 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Aug 2023 03:28:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qVOEt-000QmF-7B for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Aug 2023 03:27:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVOEs-000Qm7-Ud for pgsql-bugs@lists.postgresql.org; Mon, 14 Aug 2023 03:27:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVOEl-000161-Nr for pgsql-bugs@lists.postgresql.org; Mon, 14 Aug 2023 03:27:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 37E3RJNn791481; Sun, 13 Aug 2023 23:27:19 -0400 From: Tom Lane To: arasopero.1@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18054: Permission denied. In-reply-to: <18054-792b6eaac27319ad@postgresql.org> References: <18054-792b6eaac27319ad@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 13 Aug 2023 04:26:48 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <791479.1691983639.1@sss.pgh.pa.us> Date: Sun, 13 Aug 2023 23:27:19 -0400 Message-ID: <791480.1691983639@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I can not make backup and restoration of my db by this issues: > baap@baap-notebookpc:~$ sudo su postgres > [sudo] password for baap: > postgres@baap-notebookpc:/home/baap$ psql > could not change directory to "/home/baap": Permission denied > psql (15.4 (Ubuntu 15.4-1.pgdg22.04+1)) You have not shown an actual failure here. The "could not change directory" warning might be alarming, but you have not explained how it causes you any problem. What is actually happening, I think, is that psql is chdir'ing to someplace else in pursuit of figuring out its own absolute path, and then it tries to chdir back to where it was started from, and fails because that directory is not readable by the postgres user. It produces a warning about that but continues anyway. So this doesn't affect your ability to use SQL commands, but it might affect your ability to run meta-commands that expect the current working directory to be "/home/baap". However, given that psql could not read any files within that directory, it's not clear to me what practical problem ensues that wouldn't manifest in some other form anyway. regards, tom lane