By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

limit database size

exoskeleton
100+
P: 104
hi dear experts, pls help. i was asked by my boss to limit the size of the database to 10MB per account holder. how can this be done? any code will be greatly appreciated...im using PHP and postgre database

pls help thank you...
Jan 24 '07 #1
Share this Question
Share on Google+
4 Replies


ronverdonk
Expert 2.5K+
P: 4,258
I think this can better be answered by PostgreSQL experts. So I will move it to the PostgreSQL forum.

Ronald :cool:
Jan 24 '07 #2

Expert 100+
P: 534
In addition to the answer to your duplicate posting -
http://www.thescripts.com/forum/thread592201.html
- you can consider using a file system facilities (that is if you' running on a UNIX platform which has a support for per-user disk quota)

Provided that /dbdata is a quota-enabled partition you can try something like this:
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLESPACE dbspace LOCATION '/dbdata'; 
  2. CREATE DATABASE db_dbuser OWNER dbuser TABLESPACE dbspace;  
  3.  
See the Postgres manual, CREATE TABLESPACE and CREATE DATABASE for details.

I don't like this approach, because if you run out of disk space and cannot commit a transaction you may have to do some work to recover the database.
Jan 24 '07 #3

exoskeleton
100+
P: 104
ok sir thank you.. i will read the manual for this command.
Jan 25 '07 #4

exoskeleton
100+
P: 104
I think this can better be answered by PostgreSQL experts. So I will move it to the PostgreSQL forum.

Ronald :cool:
thank you sir for moving to the right forum sir ronverdonk
Jan 25 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.