quota on database - Mailing list pgsql-admin

From Marek Florianczyk
Subject quota on database
Date
Msg-id 1051544035.5274.117.camel@franki-laptop.tpi.pl
Whole thread Raw
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Gémes Géza
Date:
Subject: Users fo ONE database
Next
From: "dlangschied"
Date:
Subject: Logical Fields in postgres.