Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDRg8-00061v-Ad for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2014 04:44:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WDRg7-0001Sv-RI for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2014 04:44:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDRg7-0001Sp-A4 for pgsql-docs@postgresql.org; Wed, 12 Feb 2014 04:44:07 +0000 Received: from mail-ie0-x231.google.com ([2607:f8b0:4001:c03::231]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDRg4-0008LO-Va for pgsql-docs@postgresql.org; Wed, 12 Feb 2014 04:44:06 +0000 Received: by mail-ie0-f177.google.com with SMTP id rp18so483770iec.36 for ; Tue, 11 Feb 2014 20:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YbIj4f/r9lxT6IeF6WbnvejNPfW8vTCZr+/BnIygz1M=; b=K/Xni/ynx6P/fBIG6mFg5tOimF47RZfQm5WF525WkKeaR+91Ayn5wBFV4Cr4Lf5M0n Daw27r5gCiqh3FWv1x3aGwnSmEu+opoICejOLF7m0gS3I8XXEbB05t7fb81o3oYylPlm 8YivKmrbFl2XGyYY9LHlbX50RCYpJGiXI8KFuqN62DHkY+EF7btkcy4ph36bW/5pfvEC 8GniXQgwSUPlL6Hf1aHvqBEmqkSH2wYEItiZ447X+RjnwZPF8fP0wXbP2yAxxyVjCCNg aQXt0ZJmQsKmvOns6wImmk1tCasMQq/kkzsuFR2IgSO5FmmacA57SYClS2Bg2Co9kDm0 8DrA== MIME-Version: 1.0 X-Received: by 10.50.78.229 with SMTP id e5mr1821214igx.49.1392180243500; Tue, 11 Feb 2014 20:44:03 -0800 (PST) Received: by 10.50.87.194 with HTTP; Tue, 11 Feb 2014 20:44:03 -0800 (PST) In-Reply-To: <52FAEFEA.4060609@2ndquadrant.com> References: <52FAEFEA.4060609@2ndquadrant.com> Date: Wed, 12 Feb 2014 13:44:03 +0900 Message-ID: Subject: Re: PATCH: Warn users about tablespace abuse data loss risk From: Ian Lawrence Barwick To: Craig Ringer Cc: PostgreSQL Developers Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org 2014-02-12 12:52 GMT+09:00 Craig Ringer : > Hi all > > I've just seen another case of data loss due to misuse of / > misunderstanding of tablespaces: > > http://dba.stackexchange.com/questions/58704/how-do-i-access-a-old-saved-tablespace-after-reinstalling-postgres > > and it's prompted me to write some docs amendments to make it more > obvious that *you shouldn't do that*. > > Not that it'll stop people, but it'll at least mean they can't say we > didn't warn them. > > This is actually quite important, because many users are used to MySQL's > MyISAM, where each table contains its own metadata and is readable by > simply copying the table into a different MySQL install's data > directory. It doesn't even have to be the same version! Users are > clearly surprised that PostgreSQL tablespaces don't have the same > properties. > > Thoughts? People still use MyISAM!? I had a similar issue pop up at work a while back, having something explicit to point to is definitely a good idea. Suggestion for the first paragraph of the patch (sorry I can't provide it in patch form right now): Even if they are located outside the main PostgreSQL data directory, tablespaces are an integral part of the database cluster and cannot be treated as an autonomous collection of data files. They rely on metadata contained in the main data directory, without which they are useless. In particular, tablespaces cannot be reattached to a different database cluster, and backing up individual tablespaces makes no sense as a backup/redundancy method. Similarly, if you lose a tablespace (file deletion, disk failure, etc) the main database may become unreadable or fail to start. Regards Ian Barwick -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs