Re: How to make PostreSQL utilities honor home directories? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How to make PostreSQL utilities honor home directories?
Date
Msg-id 4ca8ca31-16b8-6c24-8ae4-04bde7510687@aklaver.com
Whole thread Raw
In response to How to make PostreSQL utilities honor home directories?  (Jeffrey Walton <noloader@gmail.com>)
List pgsql-general
On 9/1/22 3:01 PM, Jeffrey Walton wrote:
> Hi Everyone,
> 
> We are having a heck of a time getting PostreSQL utilities to honor
> home directories. For example, when I execute this script:
> 
>      sudo -H -u postgres PGPASSWORD=${password} \
>          psql -h "${hostname}" -U "${username}" -d "${database}" \
>          --command="..."
> 
> It produces failures:
> 
>      could not change directory to "/home/jwalton/godojo": Permission denied

What if you add -i?:

sudo -H -u postgres -i ...

> 
> /home/jwalton is my home directory. The postgres user does not have
> access to my stuff. The postgres user's home directory is
> /var/lib/pgsql .
> 
> Reading through the `psql --help` options and searching on the web is
> not turning up any hits.
> 
> We are also observing the errors when using pg_isready .
> 
> How to make PostreSQL utilities honor home directories?
> 
> Thanks in advance.
> 
> Jeff
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to make PostreSQL utilities honor home directories?
Next
From: Peter
Date:
Subject: Re: How to make PostreSQL utilities honor home directories?