Postgres Upgrade on Mac is not as advertised [on hold]

I have found some excellent resources on SF for upgrading Postgresql. But as is custom, my mileage varies and even the simplest things go horribly wrong.

I have been on version 9.6.5 on Mac courtesy of homebrew. I have installed 10.6. I am attempting to upgrade my old databases with the following command:

pg_upgrade -v -d /usr/local/var/postgres -D /usr/local/var/postgres10.6 -b /usr/local/Cellar/postgresql/9.6.5/bin -B /usr/local/Cellar/postgresql/10.6/bin/ 

Unfortunately (but expectedly), this does not work.

-----------------------------------------------------------------   pg_upgrade run on Thu Jan  3 17:10:45 2019 -----------------------------------------------------------------  command: "/usr/local/Cellar/postgresql/9.6.5/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/usr/local/var/postgres" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/usr/local/var/postgres'" start >> "pg_upgrade_server.log" 2>&1 waiting for server to start....FATAL:  58P01: could not open directory "/usr/local/lib/postgresql": No such file or directory HINT:  This may indicate an incomplete PostgreSQL installation, or that the file "/usr/local/Cellar/postgresql/9.6.5/bin/postgres" has been moved away from its proper location. LOCATION:  getInstallationPaths, postmaster.c:1427  stopped waiting pg_ctl: could not start server Examine the log output.   FATAL:  58P01: could not open directory "/usr/local/lib/postgresql": No such file or directory HINT:  This may indicate an incomplete PostgreSQL installation, or that the file "/usr/local/Cellar/postgresql/9.6.5/bin/postgres" has been moved away from its proper location. LOCATION:  getInstallationPaths, postmaster.c:1427 

Well…

➜  ~ cd /usr/local/lib/postgresql cd: no such file or directory: /usr/local/lib/postgresql 

I don’t even HAVE that directory!

My /usr/local/var directory looks like this:

drwxr-xr-x   5 me  admin   170B Mar 30  2015 apache2/ drwxr-xr-x   3 me  admin   102B Oct 17  2014 db/ drwxr-xr-x   4 me  admin   136B Jun  9  2017 homebrew/ drwxr-xr-x   7 me  admin   238B Sep 18  2017 log/ drwxr-xr-x  60 me  admin   2.0K Dec 31 18:02 mysql/ drwx------  30 me  admin   1.0K Jan  3 17:13 postgres/ drwx------  24 me  admin   816B Jan  3 15:58 postgres10.6/ drwx------  23 me  admin   782B Sep 18  2017 postgres9.3/ drwx------  24 me  admin   816B Jan  3 17:03 postgresql@9.6/ drwxr-xr-x   5 me  admin   170B Dec 31 18:02 run/ drwxr-xr-x   6 me  admin   204B Mar 30  2015 www/ 

What that error represents is a really bad assumption that lib files are going to be in a postgresql subdirectory of /usr/local/lib. When I look there, all of my postgresql libraries are right in there.

And besides, they’re already linked to the new 10.6 version. Why in the H*** would it be trying to bring up a 9.6 database with 10.6 libraries anyway? Doesn’t make any sense at all.

I’m dead in the water. I don’t even know what it’s looking for in the lib directory. Is this something that is even possible or should I just stay on 9.6 forever?