Re: User Quota Implementation

From: "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: User Quota Implementation
Date: 2004-07-09 16:22:49
Message-ID: 40EEC659.8070307@tvi.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Quota is currently enforced on commit. I've considered checking during
insert/update/copy and throwing an abort but within a transaction they
may be deleting data as well.

However, even as a delete may take place before a massive insert/update,
a vacuum cannot be run within a transaction block and therefore the
commit would fail at the same point as an insert/update within the
transaction itself.

So, essentially, there is no difference at which point to check other
than to reduce the calculation overhead by placing the check at the
commit point.

What's the consensus on when to check?

Alvaro Herrera wrote:
> On Thu, Jul 08, 2004 at 03:27:34PM -0600, Jonah H. Harris wrote:
>
>
>>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.
>
>
> At exactly what time is the quota enforced? Does the enforcement
> somehow serialize that operation?
>

--
Jonah H. Harris, UNIX Administrator | phone: 505.224.4814
Albuquerque TVI | fax: 505.224.3014
525 Buena Vista SE | jharris(at)tvi(dot)edu
Albuquerque, New Mexico 87106 | http://w3.tvi.edu/~jharris/

"All great truths begin as blasphemies."
-- George Bernard Shaw

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2004-07-09 16:25:03 Re: User Quota Implementation
Previous Message Bruce Momjian 2004-07-09 16:14:12 Re: Nested Transactions, Abort All