Re: Tablespace limit feature - Mailing list pgsql-general

From Stephen Frost
Subject Re: Tablespace limit feature
Date
Msg-id 20141104174611.GC28859@tamriel.snowman.net
Whole thread Raw
In response to Re: Tablespace limit feature  (John R Pierce <pierce@hogranch.com>)
Responses Postgres char type inconsistency  (Brent Wood <Brent.Wood@niwa.co.nz>)
List pgsql-general
* John R Pierce (pierce@hogranch.com) wrote:
> On 11/4/2014 9:00 AM, Alejandro Carrillo wrote:
> >I need to limit the tablespace file because I need to control the
> >hard disk space used in a tablespace
>
> so what happens if a query does something that violates the quota?

It gets cancelled.  See temp_file_limit.

> I can see one difficulty in implementation would be just keeping
> track of how much space is used in a tablespace, thats not done
> right now at all as far as I know.   every time a new block is
> allocated, a tablespace size catalog table would have to be
> updated.... and oh no, what happens if THAT table grows and
> overflows the quota of the default tablespace where the catalog is
> maintained?

There are a bunch of questions, but I doubt we'd apply the quota to
system catalogs regardless.  That does lead to an interesting question
about quotas for number of tables, or indexes, or whatever, but I tend
to doubt that's as much of an issue.  Such a quota isn't to address
individuals who are actively attempting to attack the system (there's
lots of ways to cause problems if you've got SQL-level access) but
rather just to manage space limitations among different individuals
using the system.

    Thanks,

        Stephen

Attachment

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Tablespace limit feature
Next
From: Bernd Helmle
Date:
Subject: Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE