From: Tim Cross <theophilusx@gmail.com>
To: Jonathan Leroy - Inikup <jonathan@inikup.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Commands linked to pg_wrapper not working with non-root users
Date: Thu, 12 Apr 2018 08:26:01 +1000
Message-ID: <878t9t753a.fsf@gmail.com> (raw)
In-Reply-To: <CAC88fzE-ajOudW_Gath9N5W4ofr_OXWUCVc85mSu76N==738sw@mail.gmail.com>
References: <CAC88fzE-ajOudW_Gath9N5W4ofr_OXWUCVc85mSu76N==738sw@mail.gmail.com>
Jonathan Leroy - Inikup <jonathan@inikup.com> writes:
> Hi,
>
> I'm using multiples versions of PostgreSQL from the postgresql.org
> repository (http://apt.postgresql.org/) on Debian Jessie, on multiples
> servers.
> Each postgresql-client-XX package depends on postgresql-client-common,
> which provides the pg_wrapper script
> (/usr/share/postgresql-common/pg_wrapper).
>
> A lot of PostgreSQL commands are linked to pg_wrapper. E.g.:
> /usr/bin/psql -> ../share/postgresql-common/pg_wrapper
>
> Here's my issue : when I'm logged as an user which is not root or
> postgresql, I can't use any of the commands linked to pg_wrapper:
>
> user1@server1:~ $ /usr/bin/psql --version
> Error: Invalid data directory
>
>
> However, everything works with postgres or root user:
>
> root@server1:~ # /usr/bin/psql --version
> psql (PostgreSQL) 9.4.16
>
>
> Also, everything works fine if I bypass pg_wrapper:
>
> user1@server1:~ $ /usr/lib/postgresql/9.4/bin/psql --version
> psql (PostgreSQL) 9.4.16
>
> I am missing something ?
>
> Thanks,
Check your settings in /etc/postgresql-common/user_clusters. The wrapper
script uses that file to determine what databases to connect to or what
is the user default database cluster. It can also be overridden with a
local ~/.postgresqlrc, so check there are no old settings there as well.
Tim
--
Tim Cross
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-general@postgresql.org
Cc: theophilusx@gmail.com, jonathan@inikup.com
Subject: Re: Commands linked to pg_wrapper not working with non-root users
In-Reply-To: <878t9t753a.fsf@gmail.com>
References: <CAC88fzE-ajOudW_Gath9N5W4ofr_OXWUCVc85mSu76N==738sw@mail.gmail.com> <878t9t753a.fsf@gmail.com>
* 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