FATAL Authentication

Lists: pgsql-admin
From: Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: FATAL Authentication
Date: 2008-06-04 20:29:09
Message-ID: B0D7C0A3F35FE144A70312D086CBCA9B0509A42F@ExchMailbox2.univ.dir.wwu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

I am trying to run commands from the shell (without becoming the postgres user first), which work fine on our live server, but on our dev server I receive FATAL authentication errors.

[root(at)dev tmp]$ createdb -U postgres lan_portal
createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "postgres"

[root(at)dev tmp]$ psql -U postgres lan_portal < /tmp/lan_portal.bck
psql: FATAL: Ident authentication failed for user "postgres"

What needs to be configured so I can run the above commands in the shell?

I was able to create the database once I "su" to postgres, using CREATE DATABASE, but I do not know how to restore a database as I do in the shell as listed above.

Thanks

Marc


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: FATAL Authentication
Date: 2008-06-04 20:42:29
Message-ID: 29366.1212612149@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu> writes:
> I am trying to run commands from the shell (without becoming the postgres user first), which work fine on our live server, but on our dev server I receive FATAL authentication errors.
> [root(at)dev tmp]$ createdb -U postgres lan_portal
> createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "postgres"

The -U option is just about entirely useless under "ident sameuser"
authentication, which apparently is what you are using. If you like
ident auth in general, you can make it do what you want by setting
up a map file that lets (eg) root become any of a list of postgres
user names. Or you could switch to some other auth method. See
http://www.postgresql.org/docs/8.3/static/client-authentication.html

regards, tom lane