From: Guillaume Lelarge <guillaume@lelarge.info>
To: Jaroslav Záruba <jaroslav.zaruba@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Why pg_dump 'trust' authentication fails under root and works under another user?
Date: Thu, 24 Mar 2011 09:03:07 +0100
Message-ID: <4D8AFABB.1010002@lelarge.info> (raw)
In-Reply-To: <AANLkTikR5sO5zYYRpNOTLUS+jUdrJKUT-vPTMgm4b88=@mail.gmail.com>
References: <AANLkTikR5sO5zYYRpNOTLUS+jUdrJKUT-vPTMgm4b88=@mail.gmail.com>
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.frhttp://dalibo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: guillaume@lelarge.info, jaroslav.zaruba@gmail.com
Subject: Re: Why pg_dump 'trust' authentication fails under root and works under another user?
In-Reply-To: <4D8AFABB.1010002@lelarge.info>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox