Re: pg_upgrade FAIL: can't find tablespaces

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Craig James <cjames(at)emolecules(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_upgrade FAIL: can't find tablespaces
Date: 2014-08-21 02:23:59
Message-ID: 20140821022359.GA26706@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 18, 2014 at 12:15:57PM -0700, Craig James wrote:
>
>
> On Mon, Aug 18, 2014 at 11:59 AM, Craig James <cjames(at)emolecules(dot)com> wrote:
>
> I did pg_upgrade from 8.4.17 to 9.3.5. The upgrade claimed it was
> successful. However, when I start Postgres 9.3.5, I get an error message
> for every one of the roughly 250 databases:
>
> LOG:  could not open tablespace directory "pg_tblspc/16828/
> PG_9.3_201306121": No such file or directory
> LOG:  could not open tablespace directory "pg_tblspc/16523/
> PG_9.3_201306121": No such file or directory
> LOG:  could not open tablespace directory "pg_tblspc/16768/
> PG_9.3_201306121": No such file or directory
> LOG:  could not open tablespace directory "pg_tblspc/16715/
> PG_9.3_201306121": No such file or directory
> ... and so forth
>
> My Postgres looks like this
>
>    /data/postgres/main  - the PGDATA directory
>    /data/postgres/tablespaces - where most of the data live
>
>
> OK, I figured this out: pg_upgrade didn't follow symbolic links. Each of the
> missing files pointed to  /data/postgres/tablespaces, but the actual directory
> was in /data/postgres-8.4/tablespaces.  When I replaced /data/postgres/
> tablespaces with a symbolic link to /data/postgres-8.4/tablespaces, everything
> worked. 
>
> Once everything is in order and I'm convinced 9.3.5 is working, I'll shut down,
> remove the symlink, and move the tablespaces directory to the new location.

Uh, I am not totally clear what happened here. I am unclear how
pg_upgrade would have moved the files yet the new server would not
start. Did you do anything between the completion of pg_upgrade and
trying to start the new server?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ashesh Vashi 2014-08-21 08:55:06 Re: [pgadmin-hackers] OF TYPE without SCHEMA specified in TABLE creation interface
Previous Message Craig James 2014-08-20 18:23:41 pg_basebackup man-page confusion?