Skip site navigation (1) Skip section navigation (2)

Re: Database Size Limiting

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Campano, Troy" <Troy(dot)Campano(at)LibertyMutual(dot)com>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database Size Limiting
Date: 2004-05-27 17:58:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

In response to

pgsql-general by date

Next:From: Joshua D. DrakeDate: 2004-05-27 18:11:47
Subject: Re: Database Size Limiting
Previous:From: Richard HuxtonDate: 2004-05-27 17:18:36
Subject: Re: custom error messages/numbers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group