Re: Database fixed size - Mailing list pgsql-general

From Tom Lane
Subject Re: Database fixed size
Date
Msg-id 14230.1475065882@sss.pgh.pa.us
Whole thread Raw
In response to Re: Database fixed size  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Responses Re: Database fixed size  (Adir Shaban <adirshaban1995@gmail.com>)
List pgsql-general
Albe Laurenz <laurenz.albe@wien.gv.at> writes:
> Adir Shaban wrote:
>> Is there anyway to limit a database size?
>> For example, I need to create a database for user X and I don't want it to use more than 5 GB.

> You can create a tablespace on a device with limited size.
> Then you can create the database on that tablespace.

Note the reference to tablespace.  It's unwise to just put the whole
cluster on a tiny device (or equivalently, attempt to solve this with
OS-level disk quotas applied to the whole installation).  The reason is
that PG gets very unhappy if it runs out of WAL space.  Hitting a limit
on table size per se behaves a bit more sanely, though even there you
can get into trouble --- for instance, in some situations VACUUM will
try to allocate additional disk space, making recovery harder.

            regards, tom lane


pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: isnull() function in pgAdmin3
Next
From: "Mike Sofen"
Date:
Subject: Re: how to monitor the progress of really large bulk operations?