arabub wrote:
If I make database calls to Postgresql, as what user is that call
going to be made? The user that Apache is running as? Can I specify
the user that the call is to be made as?
There are two different types of users here
1) The user that the Postgresql database server runs as. This is a system
user as defined in the /etc/passwd file.
2) The database user that you connect to the database as. This is a database
defined user, and it not the same as the type of user in (1).
When you create a new database you can assign a login name and password to
access that database. When you connect to the database you pass the login
name and password as defined in the database to connect to a specific
database.
This example is from the PHP manual (
www.php.net/pg-connect):
pg_connect("dbname=mary user=lamb password=foo");
In this example you are connecting to a database called "mary" as the user
"lamb". That user is who you are connecting to Postgresql as, and is a
database defined user, not a system defined one.
If you do not specify a login name and password that has already been set up
in Postgres then you won't be able to connect.
--
Chris Hope - The Electric Toolbox -
http://www.electrictoolbox.com/