Re: limit the database size - Mailing list pgsql-admin

From Rudi Starcevic
Subject Re: limit the database size
Date
Msg-id 20031010153016.M10827@oasis.net.au
Whole thread Raw
In response to Re: limit the database size  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-admin
> We were talking about separate database structures (as created by
> initdb), not separate databases within one structure.  Each separate
> structure requires a postmaster.
>
> You cannot run different postmaster instances simultaneously unless you
> differentiate them by using different ports.  The point of the original
> enquiry was for people to have their own separate database
> structures, which could be subject to disk quotas; they will not
> want to queue up to use them, will they?

Yeah I see, sorry I must be thinking too much of the similarities to
another situation instead of the original enquiry.

I'd like to add a note on how something similar works for me. Hope that's OK.

In this case we provide some hosting for uses with Postgresql/PHP/Perl.

So a new user gets a new home dir. and Pg creates the new user a database
which is the their new home dir. - the 'base' folder.
The owner is Postgresql so the new user cannot write into the 'base' folder
in their home dir.
So the user has one linux account and one Postgresql account.
Then change ownership of the database, which was created by Postgres,
to the new user's Postgresql account by updating the pg_database table.

So now the new user has a Linux shell account with a sub folder 'www'.
The user can ssh log in and write PHP/Perl scripts and use PSQL
to access their own database using their Postgresql account.

We add a quota, say 100 meg, which will limit everything including their
database.

Sorry I can't report on what happens if the database hits the quota as I
haven't had to deal with that yet. So far any user who comes close to
filling their quota is alerted and takes appropriate measures, which
may include upgrading to a higher plan.

I've got regular vacuum's happening on all databases with some cron jobs
using the Postgres account but each user can add their own custom cron
jobs if they like.

So far it's all good.

Maybe I will be pointed out to be in error somewhere but I find this
technique to be simple,elegant and powerful.

Thanks.
Regards Rudi.















pgsql-admin by date:

Previous
From: "Pichelman, Scott"
Date:
Subject: pg_dumps
Next
From: Robert Treat
Date:
Subject: Re: Oracle takes the wraps off SME database