[lug] PostgresSQL user mapping question

Hugh Brown hugh at math.byu.edu
Sat Sep 28 22:22:57 MDT 2002

The default config for postgresql on redhat systems is to require that a
users login name match the username in postgres.

If you look in /var/lib/pgsql/data/pg_hba.conf  you find the offending
line (at the bottom of the file).

local   all     ident   sameuser

If you comment that out, you might have better luck.


On Fri, 2002-09-27 at 17:42, Glenn Murray wrote:
> I am a newbie to db administration and ran into a PostgreSQL problem.
> I have an program called "ocw" which uses PostgreSQL 7.2.
> When folks download and run ocw they need to create and populate a
> PostgreSQL database.  I thought the best way to do this is to have a
> PostgreSQL user ocw which they would create as user postgres using
> createuser.  Is there a better way?  Right now the only way I can make
> this work is to have each downloader create a PostgreSQL with his or
> her own user name and have them edit a properties file from which ocw
> can pick up that name.
> Trying the ocw name didn't work.  User postgres can create user ocw
> with permission to create databases, but as user glenn or postgres:
> postgres:~$ createdb -U ocw ocwdb
> psql: FATAL 1:  IDENT authentication failed for user "ocw"
> I tried the following lines in pg_hba.conf, restarting postgresql each time,
> local	all		                                trust      OCW
> #host    all		                                trust      OCW
> #local	all trust      OCW
> #host    all trust      OCW
> and the following in pg_ident.conf:
> OCW	glenn		ocw
> OCW 	postgres	ocw
> OCW	glenn	 	postgres
> OCW	ocw		postgres
> Any advice would be appreciated.
> Thanks,
> Glenn Murray
> http://www.mines.edu/~gmurray
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug

More information about the LUG mailing list