Re: [Lxr-dev] Permission problems with Postgres?
Brought to you by:
ajlittoz
From: Jan-Benedict G. <jb...@lu...> - 2002-01-23 13:43:07
|
On Wed, 2002-01-23 22:26:18 +0900, Malcolm Box <ma...@br...> wrote in message <3C4...@br...>: > However, on doing the install, there seems to be a problem with > permissions. Specifically, I get permission denied messages when the > lxr user attempts to insert any values into the database. Now I'm not > familiar with postgres, so does anyone else experience this, or am I > just doing something wrong? > > Here's what I did: > > createuser lxr > - I answered "yes" to the permission questions to give lxr lots of rights > createdb -U lxr lxr > psql -U lxr > \i initdb-postgres Basically, it works for me. I'm regulary using PostgreSQL, I don't exactly like MySQL... What I did... I've already got a user jbglaw, capable of creating databases but not capable of creating new users. As jbglaw, I did a "createdb lxr", followed by "psql lxr" and therein a "\i initdb-postgres". This init scripts seems to work for me. Lxr is running under apache, which uses user "www-data" (which is also a user in PostgreSQL for me). So, you should additionally create a database user called like the user used by your apache and everything should be fine, because the initdb script already has grant statements. You *can't* ./genxref (with the current solution) as user www-data, read: you can't index new sources while you're your webserver's user. But that's fine with me. jbglaw created the database, granting select rights to public. www-data *is* public, so it can use the database "read only", but that needs to be enough. Nobody else than the database's creator should be granted write (read: UPDATE, DELETE or INSERT) right to the database except Last famous words: The current initdb-postgres is okay. MfG, JBG -- Jan-Benedict Glaw . jb...@lu... . +49-172-7608481 -- New APT-Proxy written in shell script -- http://lug-owl.de/~jbglaw/software/ap2/ |