Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6OBx-0004BB-6r for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 22:26:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f6OBv-00083A-Ey for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 22:26:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6OBv-0007vu-0c for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 22:26:11 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f6OBr-0004fi-UQ for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 22:26:09 +0000 Received: by mail-pl0-x243.google.com with SMTP id x4-v6so2421924pln.7 for ; Wed, 11 Apr 2018 15:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=znl4RGg0ArZSZd8l1fRbUCb4sIMkTsolDTVcjZJRzfw=; b=CKK+X7788Yc4fKpPR7Msz3hxXSgxaHyB98elj6mMttCyPQ6Iv03nhPuVzlCk9eet9q uV7+27AzIQxGMfyjZl9uNSM3sTyK0TAZSC3CyjsF8s8YGNDdEuKUf+IPBm4qQFovTB7n HVmlMeVy6i1LWdatwyijdAytdgQ4DCHLCQUJpvK+TKeomIlSPfYWAlUpF4haATkKDRNo aEwXwXb+83OMB5xnXd8VT1+NYM9l9UGydFNZevYPPymcQxz71mfJveCR51I9acITvVzT gT+tvr1SIrd2qW96G/26TMjhtDBF0pSce0c+NP6k7CwIaFd5IsH/cXvY4/bvLM6PmUM4 qeDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=znl4RGg0ArZSZd8l1fRbUCb4sIMkTsolDTVcjZJRzfw=; b=Y9c7nzblV1ecP5qcIhlKGGXdKcdfVgffBLPszixNCICgPOuH5rdBgjZ4WCO5b15/q0 uEbMbZYe/IIfZmqsOPHSrZkrXv4/+9Y1l4fotbQNfRFx2olKEKukdg0Lsno9g+AJ85Lw SJApsURggvrOy3OcGdDYqdxRTk4gJbPvE/nj/3I0P8K/iN8lpqvjRoawGb2YXcMYCnK4 IcLNwn5S5PdYN2U4VL3MC9GvyGICzOO92z03VK14+WKle7pBrEzxmcfI3NyB2CFiqyCE OP81h3rCDc95I15mqgkGDHqaeu3a78kfvlX+yaKge1cM4Wo6Or+FnXtLg42HCGz/pIqV RFUw== X-Gm-Message-State: ALQs6tAo3L+LuOriRxBUqicIVUowwbsECdnbsK7FZIyf5fi8l83FKp7s stk4EwOc/tLS9L114IbT3FD7SWTi X-Google-Smtp-Source: AIpwx4/D5rrTpccXNyDDohHXNMYeNxPfI5W7mVUHl9BZoZM9rGsTUGtyG9Y6dKoMnqcyBPFYIRMmDg== X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr6794868plp.304.1523485566652; Wed, 11 Apr 2018 15:26:06 -0700 (PDT) Received: from tim-desktop (2001-44b8-31f2-bb00-fcca-2903-1f6d-607b.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:fcca:2903:1f6d:607b]) by smtp.gmail.com with ESMTPSA id w26sm5696249pfi.17.2018.04.11.15.26.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 15:26:05 -0700 (PDT) References: User-agent: mu4e 0.9.18; emacs 25.3.1 From: Tim Cross To: Jonathan Leroy - Inikup Cc: pgsql-general@lists.postgresql.org Subject: Re: Commands linked to pg_wrapper not working with non-root users In-reply-to: Date: Thu, 12 Apr 2018 08:26:01 +1000 Message-ID: <878t9t753a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jonathan Leroy - Inikup 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