Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL8lP-0004br-15 for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 18:13:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lL8lN-0001Nv-UD for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 18:13:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL8lN-0001MZ-Lw for pgsql-general@lists.postgresql.org; Sat, 13 Mar 2021 18:13:21 +0000 Received: from susanne.redcor.ch ([178.63.103.72]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL8lM-000058-Bk for pgsql-general@postgresql.org; Sat, 13 Mar 2021 18:13:21 +0000 Received: from [192.168.0.43] (84-72-41-4.dclient.hispeed.ch [84.72.41.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robert@redcor.ch) by susanne.redcor.ch (Postfix) with ESMTPSA id 6953BA029C; Sat, 13 Mar 2021 19:13:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=redcor.ch; s=201908; t=1615659199; bh=RQAFWfSF677u8LYpkbVGA30TWimsU5NaMZGH4Wr5+Bs=; h=Subject:To:References:From:Date:In-Reply-To:From; b=jLL885obQ+Hgr/5IOCq9LEUtlrKlvP7f12IDKK9vCgLHaf2+gAzwptmml4aIBTZli BnK9J2rCA1aml7mRV0QulosgBpp3Mk6ekT6HQqSviJY/xSza/OKrAhHeioy1Nruk2m ZFdgnBA/1B9KD0/8CynpcyDcr6g5Y/YMMDnVmr4BkkDyzxPK+mWasyunuzSCaajrQi bxj7dYoHsEGICcW7/i/XTfk9K9Bv4djfrHEfXdTBOJQTmtUDsbkDPUBMoHOX3hnRSD Ky7UNFaeIFZzu+Y9kqvL3p7pqeKX2oEvWAexL3Eqs5AdDNcdtlnLWNMDm2xwsoYMhe sQxQa/uUzMUeg== Subject: solved: Re: how to set permission, so I can run pg_dumd in a cron job To: robert rottermann , "pgsql-general@postgresql.org" References: <08762210-ad92-7b0d-a1bc-45301bd76582@redcor.ch> <5eb2f955-8bfe-0b84-72ac-0110fb2b4c29@redcor.ch> <2879d30f-e295-67bb-d906-710c2ec505b5@aklaver.com> From: robert rottermann Message-ID: <0071278e-4f2c-ee1b-bb41-191524d145fe@redcor.ch> Date: Sat, 13 Mar 2021 19:13:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <2879d30f-e295-67bb-d906-710c2ec505b5@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks again Adrian On 13.03.21 18:37, Adrian Klaver wrote: > On 3/13/21 9:25 AM, robert rottermann wrote: >> >> Adrin, thanks >> > >>>> can you please give me a hand >>> >>> 1) Did you have the server reload the conf files after making the changes? >> yes I did >>> >>> 2) Is there an entry for something like: >>> >>> local   all     all  peer >>> >>> before the lines you show above? >> >> no >> >> I added the whol pg_conf at the end. >> >> There is one thing particulare with the installation. >> >> I have postgresql 9.5 and 10.0 on the box. >> >> now when I check >> >> pg_dump -V >> pg_dump (PostgreSQL) 9.5.24 >> >> root@elfero:~# ll /usr/bin/pg_dump >> lrwxrwxrwx 1 root root 37 Nov 13  2019 /usr/bin/pg_dump -> >> ../share/postgresql-common/pg_wrapper* >> >> when I switch to user postgres, and the us psql, I get the following: >> >> root@elfero:~# su postgres >> postgres@elfero:/root$ psql -d  elfero >> could not change directory to "/root": Permission denied >> psql (10.16 (Ubuntu 10.16-0ubuntu0.18.04.1), server 9.5.24) >> Type "help" for help. >> >> looks, as if I have a mess with this two instances. >> >> >> How can I best clean that up. >> >> I need only PostgreSQL 10 > > From command line what does pg_lsclusters show? root@elfero:~# pg_lsclusters Ver Cluster Port Status Owner    Data directory                             Log file 9.5 main    5432 online postgres /mnt/HC_Volume_8755337/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log 10  main    5433 down   postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log > > Which pg_hba.conf file did you change?  The one in: > > /etc/postgresql/9.5/main > > or > > /etc/postgresql/10/main > > > To specify a version of pg_dump to use do something like: > > pg_dump --cluster 10/main -d some_db -U some_user -p some_port > > The important part is the some_port. You will need to use the one specified > for the instance(cluster) as returned by the pg_lscluster command. I did in deed change the wrong file now, I need remove one of the two postgresql versions, but for this I will open a new question thanks and have a nice weekend Robert > >> >> thanks again >> >> robert >> >> > >> # Database administrative login by Unix domain socket >> #local all postgres peer >> # TYPE DATABASE USER ADDRESS METHOD >> # "local" is for Unix domain socket connections only >> local all all trust >> # IPv4 local connections: >> host all all 127.0.0.1/32 trust >> q# IPv6 local connections: >> host all all ::1/128 md5 >> # Allow replication connections from localhost, by a user with the >> # replication privilege. >> local replication all peer >> host replication all 127.0.0.1/32 md5 >> host replication all ::1/128 md5 > >