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 1lL8Cu-0002RB-8l for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 17:37:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lL8Ct-0001Uu-2a for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 17:37:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL8Cr-0001OB-J0 for pgsql-general@lists.postgresql.org; Sat, 13 Mar 2021 17:37:42 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL8Cp-0004Uw-5P for pgsql-general@postgresql.org; Sat, 13 Mar 2021 17:37:40 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9123E1CA2; Sat, 13 Mar 2021 12:37:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 13 Mar 2021 12:37:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=l AebinqHX19qN2WmlnXBM7YZH4HsDW97SyrRza8osf8=; b=Hs55QsRO269Dv3Pxe 3bJMWnHASHDr+O6r43xI7bPB5JXuLhXMJGU9paNjZn8s/SPjEZeAgYssFUJ5gdww J2+pdhAkDk6lZvSYLB5ji/TcHFvvBjqIx3hGof3Sy2vMJtc+nVHplHP26YhrsPxg oRhRIGy1qPWw1qAnWvpPra4xQuN2KJPkw+1DeRwbRjq1jE5lhErVHArAmMxyR9Bb QZ4f7fNs2b8Uu1Enps9CK87zEsofDvEZqclzGTJB4tZNzozNQOlgP6x0+iCHKLzi a4ryehk7BkX2llmnAoa1w7Xvba3Nqcc7gI7CczF0+clhbhtOVSFn7n8Qz8OHI03M xXzhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=lAebinqHX19qN2WmlnXBM7YZH4HsDW97SyrRza8os f8=; b=rySwx+NukP1TWTCD+0N3zvYAZfRFIewlPwiJJXL1pFi0E4iEkhZD0JmBH Oc7DH5T9ZLmY+D/SgwmH853o6Se4J+5jokFo5lR2SngYGPBrAxXMDPVyGivU/uZJ LcE6zcd36wRzUOfRLNZfnBYITYRYNfSRIWPZ+4Ai9A39W6pXy/a5FMpHfRlntI1/ 9yz0iQV20ADoHW8A0cZaR6vevllRinhlBMbXpdfDphV9R+zO2BFJTNdnOpZEg4Ol vK6rTyJslQNlSmCdpriVKkxpsTv+EM7d/bqEM5U1EO5LT31vZ2/+w5QGutqkOGkq 8X9Djo7ZyRXR2LqPFuwmY3vIRO4Iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvgedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepveevfeevfeeugeffkeekhfegieeufffgteeujedv gffhueejjefhkeejleegtdegnecukfhppeeljedruddufedrvddujedrvdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id B28A524005A; Sat, 13 Mar 2021 12:37:34 -0500 (EST) Subject: 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> From: Adrian Klaver Message-ID: <2879d30f-e295-67bb-d906-710c2ec505b5@aklaver.com> Date: Sat, 13 Mar 2021 09:37:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <5eb2f955-8bfe-0b84-72ac-0110fb2b4c29@redcor.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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? 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. > > 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 -- Adrian Klaver adrian.klaver@aklaver.com