Re: PostgreSQL users on webhosting - Mailing list pgsql-general

From Jeff Davis
Subject Re: PostgreSQL users on webhosting
Date
Msg-id 1104913061.2886.10.camel@jeff
Whole thread Raw
In response to PostgreSQL users on webhosting  (Michal Hlavac <hlavki@medium13.sk>)
Responses Re: PostgreSQL users on webhosting
List pgsql-general
In a typical setup, you might do:

Edit pg_hba.conf to allow connections to the database "sameuser" which
is a special word meaning that the user can only connect to a database
of the same name.

Then, for each webhosting account you make (let's say the user is named
"foo" with password "bar"), execute the following SQL:

=# CREATE DATABASE foo;
=# CREATE USER foo WITH PASSWORD 'bar';

That works for most situations.

However, for truly good seperation, I recommend that you run a seperate
instance of postgresql (with a seperate $PGDATA directory) for each
user, and run it under the UID of that user. It requires a little more
disk space per account, but in a dollar amount it's virtually zero with
today's disk prices. You will be able to tie the user into filesystem
quotas, etc., much more easily, and also you could tune the DBs to the
individual users if needed.

Regards,
    Jeff Davis

On Tue, 2005-01-04 at 14:06 +0100, Michal Hlavac wrote:
> hello,
>
> we have some webhosting servers and we can start postgresql support...
>
> I need to create for one webhosting account one postgresql account,
> which will have access only to databases created byh this postgresql
> account.
>
> I know, that it is no problem in mysql...
>
> thanx, miso
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: [Fwd: How to use LISTEN / NOTIFY in a Perl program]
Next
From: Eric Brown
Date:
Subject: Passing a ROWTYPE to a function