User Quota Implementation
| От | Jonah H. Harris |
|---|---|
| Тема | User Quota Implementation |
| Дата | |
| Msg-id | 40EDBC46.9060606@tvi.edu обсуждение исходный текст |
| Ответы |
Re: User Quota Implementation
Re: User Quota Implementation Re: User Quota Implementation |
| Список | pgsql-hackers |
All,
Out of necessity, I've implemented user quotas in 7.4.3. What would the
process be for having this reviewed and combined? I have a patch for
7.4.3 ready, but wanted to know if you suggest that I patch the latest
cvs instead. Below if some information on the implementation.
=======================================================================
-- FACTS --------------------------------------------------------------
=======================================================================
1. Only a superuser can modify user quotas.
2. The minimum quota size is 1K.
3. The maximum quota size is (currently) the maximum of int4*1024 bytes.
4. Altering a user's quota does not make a change to their current data.
5. If you modify a user's quota to smaller than their current amount,
they will be unable to add any more data... but their current schema is
not truncated.
=======================================================================
-- SQL CHANGES --------------------------------------------------------
=======================================================================
COMMAND: ALTER USER
*** NEW SYNTAX ***
ALTER USER name [ [ WITH ] option [ ... ] ]
where option can be:
[ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password' | CREATEDB | NOCREATEDB | CREATEUSER
|NOCREATEUSER | VALID UNTIL 'abstime' | QUOTA file_size | NOQUOTA
where file_size is:
integer[K | M | G]
K = Kilobytes M = Megabytes G = Gigabytes
=======================================================================
-- USAGE EXAMPLES -----------------------------------------------------
=======================================================================
*** VARIATIONS OF QUOTA SIZES *** ALTER USER someuser QUOTA 50M; ALTER USER someuser QUOTA 1G; ALTER USER
someuserQUOTA 500K;
*** GIVE USER AN UNLIMITED QUOTA *** ALTER USER someuser NOQUOTA;
=======================================================================
-- INTERNAL CHANGES ---------------------------------------------------
=======================================================================
pg_shadow has added attribute userquota of type int4
pg_user view has added attribute (pg_shadow.userquota) to selection.
ADDED KEYWORDS
QUOTA NOQUOTA
--
Jonah H. Harris, UNIX Administrator | phone: 505.224.4814
Albuquerque TVI | fax: 505.224.3014
525 Buena Vista SE | jharris@tvi.edu
Albuquerque, New Mexico 87106 | http://w3.tvi.edu/~jharris/
"All great truths begin as blasphemies." -- George Bernard Shaw
В списке pgsql-hackers по дате отправления: