Re: Database Size Limiting - Mailing list pgsql-general

From Richard Huxton
Subject Re: Database Size Limiting
Date
Msg-id 40B62C55.5010801@archonet.com
Whole thread Raw
In response to Database Size Limiting  ("Campano, Troy" <Troy.Campano@LibertyMutual.com>)
List pgsql-general
Campano, Troy wrote:
> Is there a way to limit the size that an individual database can take
> up?
>
> My understanding is that all your databases go into a file system which
> is your 'catalog cluster'.
>
> But all the databases can grow until that filesystem is full.
>
> Is there a way to limit how big a database can be? Can you allocated
> space when the database is set up so you can say db1 can only be 100 MB?

Well, you've got two main options:
1. Run multiple instances of PG
If you run each as its own user "postgres1","postgres2" etc then you can
use the standard user permissions to control resource usage.

2. Place each database on its own volume
Mount one volume per database, move and symlink that database to the
volume. If you volume is only 100MB then the database will stop there.

Of course, what you probably want to do is monitor each folder (tip -
the folder names in .../data/base are the OIDs of databases) and warn at
75MB and disallow access if usage is 125MB for more than 24 hours.
That's something outside of PG's control, but someone will have done it.

Oh - final option would be one of the virtual server setups which let
you allocate resource limits per vserver.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: custom error messages/numbers
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Database Size Limiting