Re: With which user Apache accesses PostgreSQL

From: Frank Joerdens <frank(at)joerdens(dot)de>
To: Paulo Parola <pgsql(at)brazilinfo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: With which user Apache accesses PostgreSQL
Date: 2001-03-05 07:14:08
Message-ID: 20010305081408.A26175@rakete.joerdens.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Mar 04, 2001 at 08:07:20PM -0300, Paulo Parola wrote:
[ . . . ]
> >
>
> My question should be: with which user Apache accesses PostgreSQL? From the
> message issued by PostgreSQL it is user 'apache'.

On most systems it seems to be either wwwrun or nobody by default.

>
> Does that mean that *any* tables accessed through the Web should be owned by
> an user named 'apache' created with PostgreSQL program 'createuser'?

No, it just means that you need to grant this user permission to read
data from a table owned by someone else, or write to it if that's
necessary (think about whether to allow that or not; it might be a
security risk) with the grant command:

Command: GRANT
Description: Grants access privilege to a user, a group or all users
Syntax:
GRANT privilege [, ...] ON object [, ...]
TO { PUBLIC | GROUP group | username }

e.g.:

grant select on <table> to apache;

Regards, Frank

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zuev Dmitry 2001-03-05 09:01:42 Why SELECT OWNER.TABLENAME.COLUMNNAME not working ?
Previous Message Jeff Davis 2001-03-05 06:37:10 Re: Two way encription in PG???