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