Re: [SQL] connecting with password - Mailing list pgsql-sql

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [SQL] connecting with password
Date
Msg-id m0zHJcB-00006FC@druid.net
Whole thread Raw
In response to connecting with password  (Eric McKeown <ericm@palaver.net>)
Responses Re: [SQL] connecting with password  (Eric McKeown <ericm@palaver.net>)
List pgsql-sql
Thus spake Eric McKeown
> Is there any way to set up special password protections for a Postgres
> database, so that I can force someone to present a username and password
> when connecting from a PHP script?  I've combed the docs for something on
> this, and I may just be completely off base on the feasibility.

What I do is run the page as the database owner (I run a separate Apache
on a different port) and use the Apacher server password protections.
Just remember to check who the remote user is every time you do any
operation where the specific user is important.  If you just need to
make a general restriction on a database for a group then the protection
in the config files (or .htaccess) should be fine.

How you do this in PHP is up to you.  I do it all in Python.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-sql by date:

Previous
From: Daniele Orlandi
Date:
Subject: Re: [SQL] connecting with password
Next
From: Eric McKeown
Date:
Subject: Re: [SQL] connecting with password