Re: Commands linked to pg_wrapper not working with non-root users

From: Tim Cross <theophilusx(at)gmail(dot)com>
To: Jonathan Leroy - Inikup <jonathan(at)inikup(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Commands linked to pg_wrapper not working with non-root users
Date: 2018-04-11 22:26:01
Message-ID: 878t9t753a.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Jonathan Leroy - Inikup <jonathan(at)inikup(dot)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(at)server1:~ $ /usr/bin/psql --version
> Error: Invalid data directory
>
>
> However, everything works with postgres or root user:
>
> root(at)server1:~ # /usr/bin/psql --version
> psql (PostgreSQL) 9.4.16
>
>
> Also, everything works fine if I bypass pg_wrapper:
>
> user1(at)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-04-11 22:28:12 Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2
Previous Message Tom Lane 2018-04-11 22:19:57 Re: Commands linked to pg_wrapper not working with non-root users