Re: Root acces to databases without being prompted for password - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: Root acces to databases without being prompted for password
Date
Msg-id 4C934EA80200002500035957@gw.wicourts.gov
Whole thread Raw
In response to Root acces to databases without being prompted for password  (Rafael Barrera Oro <borafael@gmail.com>)
List pgsql-admin
Rafael Barrera Oro <borafael@gmail.com> wrote:

> I've "inherited" a pgsql database (in linux server, already
> configured and set up) and i noticed that the root user can access
> a particular database without being prompted for password (using
> the psql command).
>
> I assume it's something related to database ownership and user
> permissions but i can't find exactly what is causing this.
>
> I'd like to replicate this behaviour for other database since my
> goal is to use the root user for executing cron task (where a
> password prompts is highly annoying)

That's probably because of the configuration in the pg_hba.conf
file:

http://www.postgresql.org/docs/current/interactive/auth-pg-hba-conf.html

or maybe the .pgpass file:

http://www.postgresql.org/docs/current/interactive/libpq-pgpass.html

By the way, I would seriously consider setting this for a "database
superuser" login related to an OS login which owns the database,
rather than the root account.  Using root anytime it's not
absolutely necessary is generally not good practice.

-Kevin

pgsql-admin by date:

Previous
From: Rafael Barrera Oro
Date:
Subject: Root acces to databases without being prompted for password
Next
From: badair@epc-instore.com
Date:
Subject: Ingres statdump equivalent for postgresql