Re: PostgreSQL users on webhosting

From: Jeff Davis <jdavis-pgsql(at)empires(dot)org>
To: Michal Hlavac <hlavki(at)medium13(dot)sk>
Cc: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL users on webhosting
Date: 2005-01-05 08:17:41
Message-ID: 1104913061.2886.10.camel@jeff
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Brown 2005-01-05 13:04:03 Passing a ROWTYPE to a function
Previous Message Stuart Bishop 2005-01-05 08:01:30 Re: PostgreSQL 8.0.0 Release Candidate 3