Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B0CB31337BCC for ; Thu, 24 Mar 2011 05:03:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 92475-02 for ; Thu, 24 Mar 2011 08:03:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id 72A841337B96 for ; Thu, 24 Mar 2011 05:03:08 -0300 (ADT) Received: from [192.168.10.3] (ASte-Genev-Bois-153-1-85-140.w81-48.abo.wanadoo.fr [81.48.35.140]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 1DA633B8F5; Thu, 24 Mar 2011 09:03:08 +0100 (CET) Message-ID: <4D8AFABB.1010002@lelarge.info> Date: Thu, 24 Mar 2011 09:03:07 +0100 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: =?UTF-8?B?SmFyb3NsYXYgWsOhcnViYQ==?= CC: pgsql-admin@postgresql.org Subject: Re: Why pg_dump 'trust' authentication fails under root and works under another user? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/221 X-Sequence-Number: 37093 Le 24/03/2011 08:34, Jaroslav Záruba a écrit : > Hello > > I have pg_dump command in cron that accesses PostgreSQL under user postgres > and does not provide a password. > > pg_dump --username=postgres ... > > I have set in pg_hba.conf that user postgres should be trusted for all > databases from localhost. > > local all postgres trust > > When I run the command under regular user it works. > When I run it under root (sudo -i) it requires password, and therefore the > crontab task fails to authenticate. > Are you sure the password is not asked by the sudo command, rather than by the pg_dump one? -- Guillaume http://www.postgresql.fr http://dalibo.com