Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 15FFB1337990 for ; Thu, 24 Mar 2011 07:25:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 08820-10 for ; Thu, 24 Mar 2011 10:25:17 +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 3A3B7133616B for ; Thu, 24 Mar 2011 07:25:15 -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 E850A3B8F5; Thu, 24 Mar 2011 11:25:14 +0100 (CET) Message-ID: <4D8B1C09.4050609@lelarge.info> Date: Thu, 24 Mar 2011 11:25:13 +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: PostgreSQL - mailing list Subject: Re: Why pg_dump 'trust' authentication fails under root and works under another user? References: <4D8AFABB.1010002@lelarge.info> <4D8B0758.8020707@lelarge.info> <4D8B0E9B.9050206@lelarge.info> 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/229 X-Sequence-Number: 37101 Le 24/03/2011 10:39, Jaroslav Záruba a écrit : > The command line is still the same, when executed under one user it does not > ask for password, when executed under another (root that is) it does: > pg_dump --ignore-version --host=localhost --port=5432 --username=postgres > --file="$BACKUP_FILE" --format=p --column-inserts --encoding=UTF-8 db123 > The "--host=localhost" option says you're using TCP/IP connection (so the "host lines" of pg_hba.conf), so it's asking for md5 authentication. Hence the password. If one user is not asked for a password, it could be that this user has a .pgpass file telling pg_dump which password to use. -- Guillaume http://www.postgresql.fr http://dalibo.com