Re: With which user Apache accesses PostgreSQL - Mailing list pgsql-general

From Frank Joerdens
Subject Re: With which user Apache accesses PostgreSQL
Date
Msg-id 20010305081408.A26175@rakete.joerdens.de
Whole thread Raw
In response to With which user Apache accesses PostgreSQL (was Re: How to automatically start postmastrer with TCP/IP support (-i option) ???)  ("Paulo Parola" <pgsql@brazilinfo.com>)
Responses Re: Re: With which user Apache accesses PostgreSQL
List 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

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Two way encription in PG???
Next
From: "KoPra Workshop"
Date:
Subject: postmaster confiugration and hardware configuration