Re: "Quota"

From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: "Hannes Dorbath" <light(at)theendofthetunnel(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "Quota"
Date: 2007-06-27 14:58:46
Message-ID: 758d5e7f0706270758l626be9a7j80fcf918595adf94@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/27/07, Hannes Dorbath <light(at)theendofthetunnel(dot)de> wrote:
> What would be a solution to prevent a single user/schema to fill the
> disk using PostgreSQL? Is it a good idea to use separate table spaces?

I am afraid currently you are stuck with tablespaces as a quoting tool.

Of course having a filesystem per user per quota is not feasible in
most circumstances. I am contemplating using XFS filesystem's
quota to achieve per-directory quota. Basically what you need is
use xfs_quota command. Here's manual excerpt about enabling it:

Enabling project quota on an XFS filesystem (restrict files in
log file directories to only using 1 gigabyte of space).

# mount -o prjquota /dev/xvm/var /var
# echo 42:/var/log >> /etc/projects
# echo logfiles:42 >> /etc/projid
# xfs_quota -x -c 'projects -c logfiles' /home
# xfs_quota -x -c 'limit -p bhard=1g logfiles' /home

I haven't used it yet, but it does look promising (other than that,
there's ZFS if you are a Sun shop ;-))

Nooow, as we are saying, XFS has yet another nice thing: xfs_fsr
command which does online filesystem level defragmentation (for
example as a nightly job). It does mix nicely with PostgreSQL's
1-GB table files.. :)

Regards,
Dawid

In response to

  • "Quota" at 2007-06-27 08:29:27 from Hannes Dorbath

Responses

  • Re: "Quota" at 2007-06-27 15:17:13 from Hannes Dorbath

Browse pgsql-general by date

  From Date Subject
Next Message Danyelle Gragsone 2007-06-27 15:10:31 Re: postgres and webmin
Previous Message Hannes Dorbath 2007-06-27 14:52:09 Re: "Quota"