On Mon, Aug 18, 2014 at 11:59 AM, Craig James <cjames@xxxxxxxxxxxxxx> 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 directoryLOG: could not open tablespace directory "pg_tblspc/16523/PG_9.3_201306121": No such file or directoryLOG: could not open tablespace directory "pg_tblspc/16768/PG_9.3_201306121": No such file or directoryLOG: could not open tablespace directory "pg_tblspc/16715/PG_9.3_201306121": No such file or directory... and so forthMy 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.
Craig
Urgent question: Having started 9.3 (briefly), is it possible to revert to 8.4? Or do I have to fully revert my 750GB database from a backup?Question 2: Is there a way to get 9.3 to work? Something I did wrong with table spaces, or a step I missed?I pretty much ran pg_upgrade per the instructions. See complete command and output below.Thanks,Craig
/usr/local/pgsql-9.3.5/bin/pg_upgrade \--link \--user=postgres \--old-bindir=/usr/local/pgsql-8.4.17/bin \--new-bindir=/usr/local/pgsql-9.3.5/bin \--old-datadir=/data/postgres/main \--new-datadir=/data/postgres-9.3/main \--jobs=4
Performing Consistency Checks-----------------------------Checking cluster versions okChecking database user is a superuser okChecking for prepared transactions okChecking for reg* system OID user data types okChecking for contrib/isn with bigint-passing mismatch okChecking for large objects warningYour installation contains large objects. The new database has anadditional large object permission table. After upgrading, you will begiven a command to populate the pg_largeobject permission table withdefault permissions.Creating dump of global objects okCreating dump of database schemasokChecking for presence of required libraries okChecking database user is a superuser okChecking for prepared transactions okIf pg_upgrade fails after this point, you must re-initdb thenew cluster before continuing.Performing Upgrade------------------Analyzing all rows in the new cluster okFreezing all rows on the new cluster okDeleting files from new pg_clog okCopying old pg_clog to new server okSetting next transaction ID for new cluster okDeleting files from new pg_multixact/offsets okSetting oldest multixact ID on new cluster okResetting WAL archives okSetting frozenxid and minmxid counters in new cluster okRestoring global objects in the new cluster okAdding support functions to new cluster okRestoring database schemas in the new clusterokSetting minmxid counter in new cluster okRemoving support functions from new cluster okAdding ".old" suffix to old global/pg_control okIf you want to start the old cluster, you will need to removethe ".old" suffix from /data/postgres/main/global/pg_control.old.Because "link" mode was used, the old cluster cannot be safelystarted once the new cluster has been started.Linking user relation filesokSetting next OID for new cluster okSync data directory to disk okCreating script to analyze new cluster okCreating script to delete old cluster okChecking for large objects warningYour installation contains large objects. The new database has anadditional large object permission table, so default permissions must bedefined for all large objects. The filepg_largeobject.sqlwhen executed by psql by the database superuser will set the defaultpermissions.Upgrade Complete----------------Optimizer statistics are not transferred by pg_upgrade so,once you start the new server, consider running:analyze_new_cluster.shRunning this script will delete the old cluster's data files:delete_old_cluster.sh
---------------------------------
Craig A. James
Chief Technology OfficerCraig A. James