pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudi Starcevic <rudi@oasis.net.au>
To: Oliver Elphick <olly@lfix.co.uk>
To: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: limit the database size
Date: Sat, 11 Oct 2003 01:30:16 +1000
Message-ID: <20031010153016.M10827@oasis.net.au> (raw)
In-Reply-To: <1065781691.2418.103.camel@linda.lfix.co.uk>
References: <008401c38ebc$ffc1c270$da17040a@lothar>
	<3F85F395.1020408@oasis.net.au>
	<3F864E09.6040500@tigrasoft.hu>
	<1065767570.2418.64.camel@linda.lfix.co.uk>
	<3F865C27.5000803@oasis.net.au>
	<1065781691.2418.103.camel@linda.lfix.co.uk>

> 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.

















view thread (10+ messages)  latest in thread

Message-ID: <20031010153016.M10827@oasis.net.au>
Permalink:  ../20031010153016.M10827@oasis.net.au/
Also on:    postgresql.org/message-id/20031010153016.M10827@oasis.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rudi@oasis.net.au, olly@lfix.co.uk
  Subject: Re: limit the database size
  In-Reply-To: <20031010153016.M10827@oasis.net.au>
  References: <008401c38ebc$ffc1c270$da17040a@lothar> <3F85F395.1020408@oasis.net.au> <3F864E09.6040500@tigrasoft.hu> <1065767570.2418.64.camel@linda.lfix.co.uk> <3F865C27.5000803@oasis.net.au> <1065781691.2418.103.camel@linda.lfix.co.uk> <20031010153016.M10827@oasis.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox