Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XKTRS-000749-J9 for pgsql-admin@arkaria.postgresql.org; Thu, 21 Aug 2014 14:34:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XKTRS-0002ih-33 for pgsql-admin@arkaria.postgresql.org; Thu, 21 Aug 2014 14:34:18 +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 1XKTRR-0002ib-9Q for pgsql-admin@postgresql.org; Thu, 21 Aug 2014 14:34:17 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XKTRN-00024i-Nq for pgsql-admin@postgresql.org; Thu, 21 Aug 2014 14:34:15 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1XKTRM-00068n-C9; Thu, 21 Aug 2014 10:34:12 -0400 Date: Thu, 21 Aug 2014 10:34:12 -0400 From: Bruce Momjian To: Craig James Cc: "pgsql-admin@postgresql.org" Subject: Re: pg_upgrade FAIL: can't find tablespaces Message-ID: <20140821143412.GC26706@momjian.us> References: <20140821022359.GA26706@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Thu, Aug 21, 2014 at 06:54:06AM -0700, Craig James wrote: > pg_upgrade ran with no complaints. The new directory was /data/postgres-9.3. > > Since I wasn't going to run 8.4 any more, I updated the symlink /postgres to > point to /data/postgres-9.3. Unfortunately, pg_upgrade hadn't created /data/ > postgres-9.3/tablespaces, since it thought they were in /postgres/tablespaces: > >     /data/postgres-9.3/main/pg_tblspc/nnnnn -> /postgres/tablespaces/xxx/ > > where "nnnnn" is the ID of the tablespace and "xxx" was the original tablespace > name. When I tried to start 9.3, I got the errors shown in my original email. > > To fix it, I simply moved /data/postgres-8.4/tablespaces to /data/postgres-9.3/ > tablespaces. Thanks for the explanation. I wanted to make sure I wasn't missing something. > One scary side effect: if I had run the cleanup script that pg_upgrade > produced, it would have deleted my entire database since /data/postgres-8.4/ > tablespaces was NOT hard linked into the new /data/postgres-9.3 directory. Yes, very scary. We have a test in the code to see if you have placed the tablespace inside the old cluster, but it can't check symlinks. We also mention this in the docs: Once you are satisfied with the upgrade, you can delete the old cluster's data directories by running the script mentioned when pg_upgrade completes. (Automatic deletion is not <-- possible if you have user-defined tablespaces inside the old data <-- directory.) You can also delete the old installation directories <-- (e.g. bin, share). Not sure what more we can do. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin