pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18054: Permission denied.
3+ messages / 3 participants
[nested] [flat]
* BUG #18054: Permission denied.
@ 2023-08-13 04:26 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 2 replies; 3+ messages in thread
From: PG Bug reporting form @ 2023-08-13 04:26 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: arasopero.1@gmail.com
The following bug has been logged on the website:
Bug reference: 18054
Logged by: Brigido Arana
Email address: arasopero.1@gmail.com
PostgreSQL version: 15.4
Operating system: UbuntuStudio 22.04
Description:
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?
Thank you very much.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #18054: Permission denied.
@ 2023-08-14 03:00 Julien Rouhaud <rjuju123@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
1 sibling, 0 replies; 3+ messages in thread
From: Julien Rouhaud @ 2023-08-14 03:00 UTC (permalink / raw)
To: arasopero.1@gmail.com; pgsql-bugs@lists.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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #18054: Permission denied.
@ 2023-08-14 03:27 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2023-08-14 03:27 UTC (permalink / raw)
To: arasopero.1@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-08-14 03:27 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-13 04:26 BUG #18054: Permission denied. PG Bug reporting form <noreply@postgresql.org>
2023-08-14 03:00 ` Julien Rouhaud <rjuju123@gmail.com>
2023-08-14 03:27 ` Tom Lane <tgl@sss.pgh.pa.us>
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