Which path to use for Kyngchaos Postgres? - macos

I am setting up a new Macbook with OSX Yosemite from scratch.
I want to install and use the KyngChaos versions of Postgres, rather than the system version of Postgres. I have downloaded the KyngChaos packages and installed them, without any errors appearing.
However, when I run psql there is nothing on my path.
If I run find it looks as though there are now two Postgres's on the machine, in these directories:
/usr/local/pgsql-9.3/bin/psql
/usr/local/pgsql/bin/psql
So my questions:
Which one is the KyngChaos package and which is system Postgres?
How should I remove the system Postgres?
How should I set my path to use the KyngChaos package?

Related

How to upgrade pgAdmin 4 on windows?

I installed pgAdmin 4 as part of the postgres installer for Windows. pgAdmin is now telling me there is a newer version (4.8, > 4.5 which I have). However, there is no built in upgrade functionality that I can see, and when I went to download and run the pgAdmin 4 installer to upgrade, it installed itself in the wrong place, leading to problems.
At first I tried installing it to the default location (C:\Program Files (x86)\pgAdmin 4\v4), which was incorrect, because the previous installation (from the postgres installer) went to a different location (C:\Program Files\PostgreSQL\11\pgAdmin 4).
The second time, I pointed it to my existing install of postgres (C:\Program Files\PostgreSQL\11\pgAdmin 4), but it installed itself to a subdirectory there instead (C:\Program Files\PostgreSQL\11\pgAdmin 4\v4), rather than upgrading the existing installation, once again yielding to duplicated installations and problems arising from that. I assume if I go download the postgres installer, it will just reinstall version 4.5 of pgAdmin, though I have not tested this.
What is the correct method for upgrading a pgAdmin instance originally installed by the postgres Windows installer?
I think the best option is to go to Program and files -> Select PostgreSQL and "Uninstall".
Uninstaller will ask you if you want to uninstall the whole application or only individual components. Select individual components and then select pgAdmin.
This will uninstall pgAdmin from PostgreSQL directory.
From now, install the latest version pgAdmin only from official website which will install it into: C:\Program Files (x86)\pgAdmin 4\v4
If you Download the installer from here https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.8/windows/
It should automatically install the 4.8 version in (C:\Program Files (x86)\pgAdmin 4\v4)
overwriting any existing 4.x version but keeping your server connections and setting.
In your case, the previous install was in a different place, therefore, you ended up having 2 versions.
What I suggest to you is go to control panel and uninstall from there all the versions you have. After that go to the above link, download and install the v4.8 in the default location. Every time there is a new version available just install it and let the installer install it on the default location.
Please note that your pgadmin server connections can be found in %appdata%\pgAdmin.
Note that I have personally just upgraded from v4.5 to v4.8 using this method (installing it in the default location) and it worked like a charm.
Not sure the best approach here.
If you update directly pgadmin from: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.10/windows/ the installation goes into
"C:\Program Files (x86)\pgAdmin 4\v4\runtime\pgAdmin4.exe"
Wheras the installation of the whole EnterpriseDB Installer from:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads is installed here:
"C:\Program Files\PostgreSQL\11\pgAdmin 4\bin\pgAdmin4.exe"
This looks like a wholly undesirable conflict? And leads to the problem identified by #Anomaly ?
To anyone finding this post (like me), before uninstalling your current pgAdmin 4, be aware that there may be limits on compatible versions based on your version of PostgreSQL. Following the instructions by Claudio Corchez, I removed my existing pgAdmin 4 and downloaded the latest 6.15. When I attempted to install it, the installer informed me that this version was not compatible with my version of PostgreSQL 10.3. So, I headed back and downloaded 4.30, which is now running. Unfortunately, it warns me each time I run it that a newer version is available. I just need to upgrade my entire PostgreSQL installation.
I had the same issue previously, and had to manually select the path.
Apparently now (v. 4.25) it auto-detects the path and updates correctly.
I had to download from the website, there was no update button embedded in pgAdmin itself

How do I properly upgrade SVN on MAC?

I'm starting on a new team who are all on PCs using TortoiseSVN with SVN version 1.9.2. I'm on a Mac OSX (El Capitan) using the Versionsapp. When I check svn --version in terminal i get 1.7.10.
When I try any svn command such as svn update I get
svn: E155021: This client is too old to work with the working copy at
'/Users/dpowell/Desktop/sites/site.org.new' (format 31).
You need to get a newer Subversion client. For more details, see
http://subversion.apache.org/faq.html#working-copy-format-change
I've gone to the site and downloaded the python script but don't know it will do anything to help (i.e. I don't know how to use it). I've also downloaded the 1.9 package and tried installing svn that way.
I'm not sure what path to take to solve this issue
The Python script you downloaded from there was to downgrade your SVN version - you need to upgrade your SVN version. I recommend going the homebrew route - it will save you lots of pain in upgrading / installing OSX packages in the future.
Follow the instructions here: http://brew.sh/
(copy that line into a terminal an press ENTER, then follow the prompts)
Then, when homebrew is installed, so update SVN, just do brew install svn.
In Terminal, type "svn --version" to find out what version you currently have
Go to http://www.wandisco.com/subversion/download#osx and download the latest client for OS X and install it. This will install the new svn into /opt/subversion/bin
Got to your terminal and check your $PATH by typing "echo $PATH". If you don't see /opt/subversion/bin in there, make sure you add it by typing export PATH=/opt/subversion/bin:$PATH. If it DOES exist and appears AFTER /usr/bin, then you may need to remove an older copy of svn that came installed on OS X. To do so, go to /usr/bin and remove all files starting with svn. This isn't an exact science but it should do the trick.
For me export PATH=/opt/subversion/bin:$PATH worked as it was installed in /opt/subversion/bin
Make sure you reload your .profile first by typing
. ./.profile*
Type "svn --version". You should see that you have the newest version installed!
brew upgrade subversion
Others solutions require you to register an Account?? forget them.

Uninstall postgresql on MacOs Lion Mountain

I'm completely new with MacOS X and I'm not underestanding where my system postgresql 9.1.5 is installed. I want to upgrade to 9.2 but I would like to uninstall this default installation before.
When I type in the terminal
$> psql --version
The result is:
psql (PostgreSQL) 9.1.5
but I can not find this installation.
MacOS X does not come with PostgreSQL installed as a server (unless you have OS X Server Edition).
Only the client-side PostgreSQL commands and the libpq library ship with the system. These include the psql command that resides is /usr/bin along with other commands such as pg_dump, pg_restore, createdb... You don't have to remove them, and if you did, it's not clear anyway what would prevent the next maintenance update of the OS to put them back.
So if you didn't previously install PostgreSQL yourself on this system, going to 9.2 is not an upgrade, it's a fresh install.
There are a number of providers of PostgreSQL packages for Mac OS X: postgres.app, homebrew, fink, macports...
These packages provide both a server and the client tools with the same version than the server, they have distinct installation paths, and they don't overwrite anything in /usr/bin. Once installed, you want to use the commands from the package preferrably to the ones in /usr/bin, which means technically putting them first in your PATH. Each package I've seen comes with a mention on how to do that in its installation instructions.
You don't have to remove the version Apple ships.
I have been using MacPorts to run various custom builds of PostgreSQL on OSX. It takes a little effort to make it "just work" (PATH and PG environment variables) but I never had to remove Apple's copy of Postgres.
I also keep a VM (VirtualBox) of a pretty minimal Debian install with Postgres running. I can do all my testing against the VM with a change of PG variables or JDBC URL. It's not as performant as running on the host but it is really clean for development.

Uninstalling macports when 'port' doesn't work

I've been trying to install a few dependencies for an application I'm running and I'm worried I might have broken the dev environment. I'm running this program on a MacBook (OSX Tiger, I don't have access to a newer one). MacPorts is officially broken, returning this error when I try and run any command:
sqlite error: near "ADD": syntax error (1) while executing query: ALTER TABLE registry.files ADD COLUMN binary bool
while executing
"registry::open $db_path"
(procedure "mportinit" line 633)
invoked from within
"mportinit ui_options global_options global_variations"
Seeing as this happens on any port __ command, I can't use the standard way of uninstalling MacPorts. However, given that I'm the one who got it in this condition in the first place, I'd rather not root around myself without knowing what I'm doing.
Is this problem fixable? Just in the interests of my own knowledge, does anyone know what exactly could have caused this error or what it actually means in terms of macport's functioning?
How can I (assuming this is necessary/a good idea) thoroughly uninstall macports? I'd rather not have to go through the trouble of reinstalling all my ports afterwards, but it's better than what I've got now.
MacPorts will usually still work on older versions of Mac OS X as the developers do not intentionally break compatibility. MacPorts officially only supports the latest release of Mac OS X and the one before (at the time of this writing this is 10.7 Lion and 10.6 Snow Leopard).
However, according to your report here, the latest MacPorts 2.1.0 upgrade seems to have compatibility problems with Mac OS X 10.4 Tiger. As indicated in the error message above, the older SQLite library version does not seem to understand the ALTER TABLE ... ADD COLUMN syntax used to update the port registry.
For this case, I assume only the upgrade procedure itself is affected and normal operation would work. This procedure is supposed to bring your MacPorts registry to a newer version required for the new features added in this release. Creating a new, empty registry would probably still work. However, this requires a full reinstall of MacPorts and all of your ports.
Please follow the uninstall instructions, but skip the first command as port cannot be executed anymore. This might leave some traces of ports installing to system locations, but in most cases this works fine. Afterwards, install MacPorts from source using the installation instructions in the guide.
This was a bug in MacPorts 2.1.0 that only affected Tiger, that was fixed in 2.1.1. If you are still running 2.0.4, you can "sudo port selfupdate" to 2.1.1 without problems. If you already ran selfupdate while 2.1.0 was out and are thus unable to use any port commands, you can re-run the last disk image installer for Tiger, and then run selfupdate to get to 2.1.1.

I have apache2 installed twice, need to uninstall one

During my newbie phases I was not aware that Max OSX had appache2 installed by default.
I manually installed it and now I have two versions running and it's extremely confusing, because at times I don't know to which version my developments point to. As of now, I have two version in the following locations:
/etc/apache2/ (I believe is the default installation)
/opt/local/apache2 (I believe this is the one I manually installed)
How do I uninstall version 2 (the one I manually installed)?
Thanks!
Being that it's in /opt, the directory MacPorts uses, have you tried port uninstall apache2?

Resources