pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mlaks <mlaks@bellatlantic.net>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue
Date: Tue, 8 Apr 2003 03:11:18 -0400
Message-ID: <200304080311.18970.mlaks@bellatlantic.net> (raw)

Hi,
I am trying to do simple adminstration tasks on a postgresql database on 
the localhost via my apache server and a cgi-perlscript.
The perlscript by itself works fine and connects to the database as 
the user "wustl". It uses Perl DBI to talk to the database.
But it wont work with apache i get error messages on my pg database
such as 

bash-2.05a$ 
FATAL 1:  IDENT authentication failed for user "nobody"

or

FATAL 1:  IDENT authentication failed for user "wustl"
pg_ctl s

whether i use the name "wustl" (the creator of the database) or 
"nobody" (in a fit of hubris and insanity i tried ot let "nobody" be a 
superuser on postgresql

I cant figure out how to set up the pg_hba.conf file to work.
I have tried using the settings

#####
local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255 trust
#######

or 

#########
local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255  ident sameuser

#######

the connection string of my perlscript was

my $conn = DBI->connect
    ("DBI:Pg:dbname=LTA_IDB","wustl","")
   or die("Cannot connect: $DBI::errstr");
 $patname = $conn->quote( $patname);

or

my $conn = DBI->connect
    ("DBI:Pg:dbname=LTA_IDB","nobody","")
   or die("Cannot connect: $DBI::errstr");
 $patname = $conn->quote( $patname); 

depending upon my try.

thanks

Mitchell Laks




view thread (3+ messages)  latest in thread

Message-ID: <200304080311.18970.mlaks@bellatlantic.net>
Permalink:  ../200304080311.18970.mlaks@bellatlantic.net/
Also on:    postgresql.org/message-id/200304080311.18970.mlaks@bellatlantic.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mlaks@bellatlantic.net
  Subject: Re: trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue
  In-Reply-To: <200304080311.18970.mlaks@bellatlantic.net>
  References: <200304080311.18970.mlaks@bellatlantic.net>

* 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