If you need to change your postgres version, or do other maintaenance work on postgres involving Homebrew, you should stop the brew service running postgres:īefore swithiching you ahve to unlink. Psql (PostgreSQL) 11.5 Stop your postgres services Postgres command line tool psql to get the active version: Your system can contain multiple versions even if there is only a single directory under /usr/local/Cellar/postgresql/. This means that your system is setup with multiple versions under one of your instalaltions. The returned list can exceed the number of actual folders, for example: You can also ask Homebrew for which versions are installed: You can check which Homebrew postgres versions you have installed from the Terminal by listing ( ls) the content of the Homewbrew postgres installation directory:Įach version of postgres resides in sub-folders and will be listed. Check installed and active (Homebrew) postgres versions The postgres actual data, however, are found under another path, /usr/local/var/postgres/. Homebrew postgres installations are found under the path /usr/local/Cellar/postgresql/. In my case I accidentally upgraded my complete Homewbrew postgres installation, while also erasing all older version. The first thing you have to do for fixing your postgres access is thus to check your installation. This particular solution includes two different installations that need to communicate: the directory where your actual database data is stored, and the Homebrew postgres installation directory. This is how I usually install postgres on Mac OSX, and it outlined in the post Install postgreSQL and postGIS. This post is only relevant if you installed postgres using Homebrew on Mac OSX. Getting Back to an Old PostgreSQL Specific Version Introduction Trying some of them, I got no one to work properly. I found a number of suggested solutions on stackoverflow. I tried restoring the postgreSQL setup uing a backup (Mac OSX TimeMachone) but secondary connection problems and incomplete installation were reported errors. Without it, it is not possible to restore or migrate your database. The Homebrew update had deleted my active postgreSQL installation (under Cellar etc). In the end I could not solve the problem. It, however, assumes that your original installation Homebrew installation of postgres is intact. It seems to me to be the best source for solving connection problems related to Homebrew updated. Trying to solve the problem I discovered the page Migrating Homebrew Postgres to a New Version by Olivier Lacan. I could restore the postgres installation from my backups (Mac OSX TimeMachine), but I could not manage to restore the connection to the actual database. But I also needed the postgres version associated with the database, and that was gone. Until I discovered that the postgres version I had been using was missing and had been replaced by the latest version. I tried several suggestions that I found in various fora online. One of the consequences was that my postgres server could not start, and I could not access the GeoImagine Framework database. For some reason my postgres setup had a havoc following an upgrade of my Homebrew installation that I, involuntarily, happened to start.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |