Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHEfM-000093-RT for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 16:43:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YHEfL-0003iW-Se for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 16:43:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YHEfK-0003iQ-J6 for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 16:43:30 +0000 Received: from lists.commandprompt.com ([69.168.55.30]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHEfG-0000dF-2V for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 16:43:29 +0000 Received: from [192.168.1.3] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 12CBB341; Fri, 30 Jan 2015 08:43:23 -0800 (PST) Received: from [192.168.1.3] ([67.168.169.165] helo=[192.168.1.3]) by assp.commandprompt.com with ESMTPS(AES128-SHA) (2.1.1); 30 Jan 2015 08:43:22 -0800 Message-ID: <54CBB4AB.1090805@commandprompt.com> Date: Fri, 30 Jan 2015 08:43:23 -0800 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Momjian , Robert Haas CC: "pgsql-hackers@postgresql.org" Subject: Re: tablespaces inside $PGDATA considered harmful References: <20150130161928.GB20744@momjian.us> In-Reply-To: <20150130161928.GB20744@momjian.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Assp-Version: 2.1.1(11364) on assp.commandprompt.com X-Assp-Client-SSL: yes X-Assp-ID: assp.commandprompt.com m1-36202-12925 X-Assp-Envelope-From: jd@commandprompt.com X-Assp-Intended-For: pgsql-hackers@postgresql.org X-Assp-Original-Subject: Re: [HACKERS] tablespaces inside $PGDATA considered harmful 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 On 01/30/2015 08:19 AM, Bruce Momjian wrote: > > On Fri, Jan 30, 2015 at 11:12:43AM -0500, Robert Haas wrote: >> I think everyone who has read this mailing list for a while is >> probably already aware of this problem. When you create a tablespace >> somewhere inside the data directory, weird things happen. If you >> pg_upgrade and then incautiously run the delete_old_cluster.sh script >> thus created, you will blow away large chunks of your data.[1] If you > > pg_upgrade doesn't create the deletion script in this case, and warns > the user: > > Could not create a script to delete the old cluster's data > files because user-defined tablespaces exist in the old cluster > directory. The old cluster's contents must be deleted manually. > >> In the short term, I favor just adding a warning, so that people get >> some clue that they are doing something that might be a bad idea. In >> the long term, we might want to do more. Thoughts? > > Yes, good idea. Uhm, wouldn't it be a rather simple patch to say: if tablespace_create() in $PGDATA: ERROR! ? I mean yes a warning is good but it is after the fact, the tablespace is already created. We know that tablespaces in $PGDATA are a bad idea, why not protect the user? JD > -- Command Prompt, Inc. - http://www.commandprompt.com/ 503-667-4564 PostgreSQL Support, Training, Professional Services and Development High Availability, Oracle Conversion, @cmdpromptinc "If we send our children to Caesar for their education, we should not be surprised when they come back as Romans." -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers