[Featureserver] permission denied to postGIS

Christopher Schmidt crschmidt at metacarta.com
Wed Aug 15 17:00:51 EDT 2007


On Wed, Aug 15, 2007 at 03:41:51PM -0500, Ed Fialkowski wrote:
> When I try from command line as "root":
> >>> db = psycopg2.connect("dbname=test")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> psycopg2.OperationalError: FATAL:  role "root" does not exist

This is a problem. If psycopg2 as the user that FeatureServer is running
as can't connect, then featureserver won't be able to.

Try (in this same python script) connecting like:

db = psycopg2.connect("dbname=test user=postgres")

It's possible this will still fail. If it does, you may need to talk to
your db admin (if this isn't your box alone) -- if it is your box, you'd
want to edit /etc/postgres (or /etc/postgresql/, or something like
that), and look for a file called something like pg_hba.conf. In it,
there will be a line that may say something like 
"127.0.0.1 ident sameuser" -- if you change that to "trust" instead of
"ident sameuser", then any local machine will be able to use whatever
username the like. With that option, you should be able to connect to
the database using "user=postgres" in your python test.



> It looks (to me) like the python in FeatureServer is not getting executed as
> postgres, because it connects fine from the command-line.
>

Yes. That sounds right -- by default, Postgres uses the current username
as the 'user' for the db. 

> So, one question is: Has anyone gotten FeatureServer to read from postGIS?
> Would you mind telling me a bit about your setup (webserver, users, etc.).

Yes, but my postgres is set up to let me talk to any database I want so
I don't have to deal with these things. (I'm lazy.)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Featureserver mailing list