From: Marek Florianczyk <franki@tpi.pl>
To: pgsql-admin@postgresql.org
Subject: quota on database
Date: 28 Apr 2003 17:33:55 +0200
Message-ID: <1051544035.5274.117.camel@franki-laptop.tpi.pl> (raw)
Hi,
We wanted to give database for our customers, bu there was a problem how
to limit database size. I made some perl script that count size of the
database directory and if exceeded:
revoke all privileges on [tablename] from [user]
grant select delete on [tablename] from [user]
But user can create new table and insert new data.
I was searching pgsql-admin archives about how to deny this, but with no
luck.
In postgres 7.3.2 ( maybe earlier ) there are schema's
Even if user is a database owner, the public schema is uid 1 (postgres )
So, in some database as postgres I do:
revoke create on chema public from [user]
Now he can't create new tables
Next:
revoke create on database [databasename] from [user]
Now he can't create new schema
So, it looks like I can control size of the database. Do you think that
this is a good idea? Maybe someone know about some trick that now allow
users to somehow insert new data?
Marek
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: franki@tpi.pl
Subject: Re: quota on database
In-Reply-To: <1051544035.5274.117.camel@franki-laptop.tpi.pl>
References: <1051544035.5274.117.camel@franki-laptop.tpi.pl>
* 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