I wrote a very basic tutorial (which also has this part in it).
http://designmagick.50megs.com/postgresql-tutorial/
It's not very comprehensive, but it has a couple of things there.
>The pg_connect command worked as localhost, but then the pg_exec failed with
>permission errors?
>
>If you started from scratch, I think you would need to do the following
>things:
>
>1) determine who the "user" is that the webserver is running as (Suggestions
>on how to do this?)
for linux, not sure if bsd is different..
# ps aux | grep http
gives a list of all the http processes running... check the first column
for the name of the process owner.
>2) set up that user in postgres with createuser (but I'm unsure how to best
>deal with the password, should it be NULL and then restrict the access or
>should it have a value that you pass as a parameter down the road? This
>ties into point 4)
I've just never set a password.
>3) give that user permissions to access the database tables in the psql
>interface with the "GRANT" command
>
>4) figure out the best way of having the webserver (as "user") connect to
>the database, e.g. the options suggested below (although I assume the first
>option implies that the user is set up with a NULL password? How would this
>work exactly?)
Since the user connecting to the database has access (as done with the
grant command).... all I do is
pg_connect("","","","","dbname");
although there might be other / better ways :)
Chris.