Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 5092F9FB209 for ; Mon, 6 Nov 2006 19:00:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 26500-07 for ; Mon, 6 Nov 2006 19:00:08 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31806.mail.mud.yahoo.com (web31806.mail.mud.yahoo.com [68.142.207.69]) by postgresql.org (Postfix) with SMTP id 7914D9F9F7F for ; Mon, 6 Nov 2006 19:00:07 -0400 (AST) Received: (qmail 3960 invoked by uid 60001); 6 Nov 2006 23:00:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ChXaIzC+7Tsb8O5MU35fz0jLJAC4lMYwitcZQeaYyw1muW56P4s7Aki+9KCMGDvFlPH7ZaYlFIpwcLDc+zOGxahAKPuWGSLOqLnQSFYj6Jn0hNKryRnj3fCIEUf3F8A8exrHgakAeaXa1Zc1Loq94rEZqy8fv0BD9XaG9TSuwl0= ; Message-ID: <20061106230004.3938.qmail@web31806.mail.mud.yahoo.com> X-YMail-OSG: 2mGZ7q4VM1lR4HeZbhvxBKvy1s4w9ZRLplCdelXJcgIckwkC.gGRedWVenbEwlaWVVjy_MF.Y0_OMPID8eIM1.sVxDz8Y3AeQP_e1pVU82E6YTBHTdrAZVKdNzyHP9yhZo7Z7ZcMzcoQgKIaQ4KVPidbvY1DpMLzjSgQlVM4YCTJBxBC0pXXGxrEaCZM Received: from [12.177.97.50] by web31806.mail.mud.yahoo.com via HTTP; Mon, 06 Nov 2006 15:00:04 PST Date: Mon, 6 Nov 2006 15:00:04 -0800 (PST) From: Richard Broersma Jr Subject: Re: Database size To: Mike Goldner , Nikola Radakovic Cc: pgsql-admin@postgresql.org In-Reply-To: <1162853096.5202.50.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.357 tagged_above=0 required=5 tests=AWL, BAYES_00, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: X-Archive-Number: 200611/39 X-Sequence-Number: 23566 > Assuming that you are running Postgres on a linux system, you could do > the following: > > 1) Create a partition with quotas enabled (via standard linux OS > procedures). The postgres user is the user for which quotas should be > enforced since postgresql always runs under the postgres uid. > > 2) Create a postgres tablespace using the newly created partition: > > psql> CREATE TABLESPACE dbspace LOCATION '/data/dbs'; > > 3) Create the database on that tablespace: > > psql> CREATE DATABASE sales OWNER salesapp TABLESPACE dbspace; > > I have not tried this myself. > > As a side note, I'd say that limiting the size of a database to an > arbitrary amount is problematic. Should a user actually exhaust the > disk quota, Postgres will be unable to commit the transaction. > Furthermore, it is difficult to recover from such a situation without > major effort. These links supplement the above comments: http://www.postgresql.org/docs/8.1/interactive/disk-full.html http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html Regards, Richard Broersma Jr.