Re: Problem Accessing PostgreSQL from Perl CGI

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ryan miller <ryemiller(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problem Accessing PostgreSQL from Perl CGI
Date: 2005-11-19 00:03:55
Message-ID: 13248.1132358635@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

ryan miller <ryemiller(at)gmail(dot)com> writes:
> DBI connect('dbname=3Dvisualizer','visualizer',...) failed: could not conn=
> ect
> to server: Permission denied

That certainly looks like a file permissions problem --- it's *not* the
PG server refusing you access, it's the kernel.

> 1) I've checked the permissions on both the /tmp directory and the socket
> file, and both are 777 (wide open)
> 2) I am able to access the database from php using pg_connect
> 3) I can access Postgres with DBI->connect when I run the perl script from
> the command line, it's when
> I try to access Postgres from the perl CGI in a web application that I get
> this message

Hm. Are you perhaps running this in a recent Red Hat or Fedora release;
if so do you have SELinux enforcement enabled; and if so, does the error
go away when you disable enforcement? If so it means the security
policy is the problem. The policy normally tries to be restrictive
about what daemon processes can do, but it's evidently being a bit too
restrictive here. Update to latest policy, and if it still fails,
file a bug against the selinux-policy component.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bill Dika 2005-11-19 03:44:33 Re: Application using PostgreSQL as a back end (experienced programmers please)
Previous Message Rainer Bauer 2005-11-18 21:23:13 Re: Large Objects in table