Postgres is uninstalled but psql --version still shows a result - postgresql

I need to install a new Version of psql on a Macbook, after i uninstall pg, i try psql --version and it still says "psql (PostgreSQL) 9.3.5."
Pg 9.6 was installed (not installed with Homebrew). I was able to uninstall 9.6. Still says 9.3.5 is installed. But i cannot find any files belonging to any Postgres application.
Is there any way to uninstall any postgtres application 100%?

There are multiple ways Postgres is installed on a Mac.
Homebrew
EnterpriseDB
Postgres.app
Hence, to uninstall, you need to do that differently.
There are different links and I'll share them here.
Homebrew - brew uninstall postgresql command would do.
EnterpriseDB - https://stackoverflow.com/a/9240197/3413323
Postgres.app - https://postgresapp.com/documentation/install.html
Hope this helps.

This may be because psql depends on postgis service, which requires psql.
If it is via Homebrew, you can run below:
brew uninstall --ignore-dependencies postgresql

Related

delete postgresql server from mac

I installed postgresql server on mac with brew install postgres because I want to practice it but it seems I installed the wrong thing? What I need is to run the installer from the official website ?
I cannot find how to uninstall the postgresql server
What you have installed was correct. But if you want to install .dmg package of postgres then you can do that as well.
First, uninstall the current version of Postgres by using
brew uninstall postgres
and then Navigate to the following below URL to get your desire Postgres .dmg package
offical Postgres .dmg for mac
Disclosure: I work for EnterpriseDB (EDB), we create and certify the Mac installers for all supported PostgreSQL versions.

Upgrade psql on Mac OS - Mismatching client and server versions. Some psql features might not work

I have just upgraded to PostgreSQL 10.11 on macOS using Homebrew and I am now getting the following message:
psql crmpicco
psql (9.6.16, server 10.11)
WARNING: psql major version 9.6, server major version 10.
Some psql features might not work.
Type "help" for help.
crmpicco=#
There's plenty of advice online for resolving this for Debian and Ubuntu, but nothing for MacOS/Homebrew.
How can I update psql locally to get rid of this message?
I suspect that you didn't run upgrade command for brew Postgres after upgrade to new version:
brew postgresql-upgrade-database
incase it didn't work, there is a gist online for home-brew Postgres upgrade, its for old version but still valid in how to upgrade in mac:
migrate_postgresql_database

Installing postgresql 9.5.3 with homebrew

I need to install postgresql 9.5.3 using homebrew. First I search for version of postgresql using
brew search postgresql
homebrew/versions/postgresql93 ✔ homebrew/versions/postgresql94
But I do not see my version. Could you help me please to install postgresql 9.5.3 with homebrew?
To install use this command on your terminal
brew install postgresql#9.5

Full uninstall of Postgresql 9.3.5

I installed postgresql 9.3.5 on OS X 10.9.4. I also used psql postgres to create database etc.
Ran in some issues where postgresql no longer works. The error is:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
So I brew uninstall postgres. Tried reinstalling but keep getting same error. I looked in the /Library.... and deleted the postgresql folder. Is there a way to fully remove this thing? I'm tempted to reinstall this mac but this is not the way to learn the long way of resolving this issue.
Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?
This should work if you had previously used brew to install postgres:
brew uninstall
Double check /usr/local/var/postgres is also gone.
If installed with EnterpriseDB, use the second answer. You might also try it as it seems to be a complete manual uninstall.
Edit: after further review, it seems this is more of an issue with Postgres on OSX where as it defaults to the local installation rather than your installation: PostgreSQL error 'Could not connect to server: No such file or directory'

Error when creating unaccent extension on PostgreSQL

I am trying to configure PostgreSQL to use fulltext search in my rails app as mentioned in this Railscast.
I am using a fresh Ubuntu 12.04 server running PostgreSQL 9.1.5 installed using apt-get with the ppa:pitti/postgresql with precise.
I get the following error when trying to run the migration and when I try the same command in the psql console with the peer postgres user:
postgres=# CREATE EXTENSION unaccent;
ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/unaccent.control":
No such file or directory
In my local box running Ubuntu 10.04 desktop I use the same repository (natty) and it works well.
Any insights would be greatly appreciated.
You need to install the package postgresql-contrib-9.1 in your system first. (Adapt to your version number! Here is the currently available list of packages.) That's the case under Debian, Ubuntu & friends anyway. Using a system user with the necessary privileges:
apt-get install postgresql-contrib-9.1
If your currently logged in user does not have the necessary privileges (but sudo rights):
sudo apt-get install postgresql-contrib-9.1
Quoting the PostgreSQL Apt Repository:
If the version included in your version of Debian is not the one you
want, you can use the PostgreSQL Apt Repository.
There are basic install instructions on the Postgres website for each available OS.
For accent-insensitive indices using unaccent consider this related question:
Does PostgreSQL support "accent insensitive" collations?
On CentOS:
sudo yum install postgres*contrib