RE: Setting Permissions for web viewing

Поиск
Список
Период
Сортировка
От Chris
Тема RE: Setting Permissions for web viewing
Дата
Msg-id 4.2.0.58.20001020084058.00a41da0@203.25.173.1
обсуждение исходный текст
Ответ на RE: Setting Permissions for web viewing  ("k" <kraznus@yahoo.com>)
Список pgsql-novice
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.

В списке pgsql-novice по дате отправления:

Предыдущее
От: "k"
Дата:
Сообщение: RE: Setting Permissions for web viewing
Следующее
От: Mike White
Дата:
Сообщение: database design