pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: arasopero.1@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18054: Permission denied.
Date: Mon, 14 Aug 2023 11:00:14 +0800
Message-ID: <20230814030014.xc4pbmdlfaxvpmcg@jrouhaud> (raw)
In-Reply-To: <18054-792b6eaac27319ad@postgresql.org>
References: <18054-792b6eaac27319ad@postgresql.org>

Hi,

On Sun, Aug 13, 2023 at 04:26:48AM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> 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))
>
> Can you help me to solve this situation?

Are you talking about the "Permission denied" line?  This is not a bug, just an
indication that the current OS user doesn't have permission to use the given
directory, and doesn't prevent you from using psql.  Of course it means that
the postgres OS user can't write data in /home/baap, and won't be able to e.g.
save the psql history, but that's something enforced at the OS level not
something postgres can change.

You could either use "sudo su - postgres" to simulate a full login and
therefore change the directory to postgres' home directory, then any if you try
to write things using a relative path it should work, provided that the
postgres OS user is correctly configured.  Otherwise you need to specify
absolute paths, pointing to directories where the postgres OS user have enough
permissions for what you want to do.





view thread (3+ messages)  latest in thread

Message-ID: <20230814030014.xc4pbmdlfaxvpmcg@jrouhaud>
Permalink:  ../20230814030014.xc4pbmdlfaxvpmcg@jrouhaud/
Also on:    postgresql.org/message-id/20230814030014.xc4pbmdlfaxvpmcg@jrouhaud

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rjuju123@gmail.com, arasopero.1@gmail.com
  Subject: Re: BUG #18054: Permission denied.
  In-Reply-To: <20230814030014.xc4pbmdlfaxvpmcg@jrouhaud>
  References: <18054-792b6eaac27319ad@postgresql.org> <20230814030014.xc4pbmdlfaxvpmcg@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox