Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 78F98951979 for ; Thu, 10 Nov 2011 23:07:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37924-04 for ; Fri, 11 Nov 2011 03:07:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-yw0-f46.google.com (mail-yw0-f46.google.com [209.85.213.46]) by mail.postgresql.org (Postfix) with ESMTP id 00D9D951978 for ; Thu, 10 Nov 2011 23:07:45 -0400 (AST) Received: by ywf7 with SMTP id 7so3751290ywf.19 for ; Thu, 10 Nov 2011 19:07:46 -0800 (PST) Received: by 10.101.198.24 with SMTP id a24mr4794698anq.132.1320980866299; Thu, 10 Nov 2011 19:07:46 -0800 (PST) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id z28sm15035927yhl.4.2011.11.10.19.07.44 (version=SSLv3 cipher=OTHER); Thu, 10 Nov 2011 19:07:45 -0800 (PST) Message-ID: <4EBC913E.7080803@ringerc.id.au> Date: Fri, 11 Nov 2011 11:06:38 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Thorsten Strufe CC: pgsql-admin@postgresql.org Subject: Re: lost tablespace References: <4EBBAF18.7080102@googlemail.com> In-Reply-To: <4EBBAF18.7080102@googlemail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/53 X-Sequence-Number: 38647 It'd help to know what Pg version you're running. Comments inline below. On 11/10/2011 07:01 PM, Thorsten Strufe wrote: > sorry, noob here. So we've just started using postgre and right at the > start we had a hardware problem with a hard drive failing. We can still > start postgre but a tablespace for a db that we don't even need anymore > is lost. Now we would think that shouldn't be a problem, we could simply > drop that db. postgre, however, doesn't allow us to, but tells us to > vacuume the db first. Starting postgre singleuser and trying to run > vacuum still gives us the same trouble. It'd be nice if PostgreSQL would `DROP DATABASE' successfully when there were missing files, just raising WARNINGs for those files. I'm not too shocked that it's not implemented though, as the files backing a database should never just go away, and if they do the database is considered severely damaged at best. > Now a naive question: is there any (sane) way to simply get postgre to > entirely forget about the broken db - and that's it (dumping the other > db and loading it back might not be the best solution, since it's rather > large..)? No sane way I know of. A less-than-sane way is to mess with pg_catalog to get rid of the database, but that's unsafe at very best. I'd just dump the other databases, then re-initdb and reload them; that's the safest way by far. > 2011-11-10 11:05:10 CET WARNING: database with OID 17546 must be > vacuumed within 999999 transactions Now that's interesting. I wonder why it thinks the database is at risk of OID wraparound? It could genuinely be, or it might be confused because the files backing the database are missing. Anyone have an opinion on whether it should be possible to drop a database that's hit or nearly hit OID wraparound w/o a vacuum first? I don't see any point vacuuming just to drop it, but this may be too much of a corner case to justify the testing a special case like this would require. -- Craig Ringer