Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHJ5K-00059X-8d for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 21:26:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YHJ5J-0003ar-0I for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 21:26:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YHJ5H-0003ak-8S for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 21:26:35 +0000 Received: from mx-out.zmailcloud.com ([192.198.85.98] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHJ5D-0005Sr-Et for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 21:26:33 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id E4072564218; Fri, 30 Jan 2015 15:26:30 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id D1E5DA028A; Fri, 30 Jan 2015 15:26:30 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AUhO51Zt47wT; Fri, 30 Jan 2015 15:26:30 -0600 (CST) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id A4A5FA033B; Fri, 30 Jan 2015 15:26:30 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 8E146A02AB; Fri, 30 Jan 2015 15:26:30 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C0OiVYeaeJwt; Fri, 30 Jan 2015 15:26:30 -0600 (CST) Received: from [172.47.23.103] (50-0-89-53.dsl.dynamic.fusionbroadband.com [50.0.89.53]) by smtp-out-1.01.com (Postfix) with ESMTPSA id DB674A028A; Fri, 30 Jan 2015 15:26:29 -0600 (CST) Message-ID: <54CBF6FE.8030209@agliodbs.com> Date: Fri, 30 Jan 2015 13:26:22 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stephen Frost , Robert Haas CC: "pgsql-hackers@postgresql.org" Subject: Re: tablespaces inside $PGDATA considered harmful References: <20150130171920.GJ3854@tamriel.snowman.net> <54CBD519.8030502@agliodbs.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert, Stephen, etc.: Apparently you can create a tablespace in the tablespace directory: josh=# create tablespace tbl location '/home/josh/pg94/data/pg_tblspc/'; CREATE TABLESPACE josh=# create table test_tbl ( test text ) tablespace tbl; CREATE TABLE josh=# \q josh@Radegast:~/pg94/data/pg_tblspc$ ls 17656 PG_9.4_201409291 josh@Radegast:~/pg94/data/pg_tblspc$ ls -l total 4 lrwxrwxrwx 1 josh josh 30 Jan 30 13:02 17656 -> /home/josh/pg94/data/pg_tblspc drwx------ 3 josh josh 4096 Jan 30 13:02 PG_9.4_201409291 josh@Radegast:~/pg94/data/pg_tblspc$ In theory if I could guess the next OID, I could cause a failure there, but that appears to be obscure enough to be not worth bothering about. What is a real problem is that we don't block creating tablespaces anywhere at all, including in obviously problematic places like the transaction log directory: josh=# create tablespace tbl2 location '/home/josh/pg94/data/pg_xlog/'; CREATE TABLESPACE It really seems like we ought to block *THAT*. Of course, if we block tablespace creation in PGDATA generally, then that's covered. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers