pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Craig James <cjames@emolecules.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_upgrade FAIL: can't find tablespaces
Date: Thu, 21 Aug 2014 10:34:12 -0400
Message-ID: <20140821143412.GC26706@momjian.us> (raw)
In-Reply-To: <CAFwQ8rf4o9=P2PGg2UO_ObbM-am=tF_6Kx_16XTH+G8Hohhyig@mail.gmail.com>
References: <CAFwQ8rcStOPG4mZoo6FNioHadEcB=6qxdpudU+eQskRJgGi0Ww@mail.gmail.com>
	<CAFwQ8rc2DFOMU_eKqMFp=AJvLkuGby3V3XjnN33ME8=nU=uiTw@mail.gmail.com>
	<20140821022359.GA26706@momjian.us>
	<CAFwQ8rf4o9=P2PGg2UO_ObbM-am=tF_6Kx_16XTH+G8Hohhyig@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

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
     <command>pg_upgrade</command> 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. <filename>bin</>, <filename>share</>).

Not sure what more we can do.

-- 
  Bruce Momjian  <bruce@momjian.us>        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



view thread (5+ messages)

Message-ID: <20140821143412.GC26706@momjian.us>
Permalink:  ../20140821143412.GC26706@momjian.us/
Also on:    postgresql.org/message-id/20140821143412.GC26706@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: bruce@momjian.us, cjames@emolecules.com
  Subject: Re: pg_upgrade FAIL: can't find tablespaces
  In-Reply-To: <20140821143412.GC26706@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox