Error when creating unaccent extension on PostgreSQL - 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

Related

install pg_stat_monitor on edb advanced server

I started playing with edb advanced server and got it installed on Rocky Linux. It is working fine with no issues.
I now want to install percona pg_stat_monitor extension using dnf.
This extension is available via PostgreSQL dnf repositories.
When I install the extension via PostgreSQL dnf repositories, It installs postgres server with it as a dependency.
This results in 2 postgres instances running on my server. i.e. 1 from edb and the other from PostgreSQL.
Is there a way to fix this issue?
All I want is to install the postgres pg_stat_monitor extension on my edb Advanced server.
thanks

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

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

How can I learn ubunu postgresql version as default?

When I install the ubuntu server, the postgresql repository package names are installed on server automatically. So when I type command sudo apt-get install postgresql it will start installation. But which version will be installed? I don't know it.
So how can I learn which version will be installed?

Howto install PostgreSQL 9.6.6 using apt-get on Ubuntu

Is it possible to use apt-get to install a very specific version of PostgreSQL. I would like to install PostgreSQL 9.6.6. I followed the instructions on the postgres download page. This will get the current latest version which is 9.6.7.
Thanks in advance.

How to find pgAdminIII GUI in Ubuntu

I got a machine where the OS is Ubuntu and already PostgreSQL has been installed. And also the credentials being provided
User Name: somename
Password: somepassword
Basically I work in Windows 8 environment and after installation of PostgreSQL, we can find it from Start charms as
How to do the same from Ubuntu?
In Ubuntu, you can install PgAdmin3 using following console command:
sudo apt-get install pgadmin3
After you've done that, you can start it from the console as pgadmin3 or you can find it in Unity by pressing Windows key and typing pgadmin.
If your Ubuntu is older than 12.04, standard provided PgAdmin may be too old to be usable and you may have to install pgadmin3 from alternative Ubuntu repository. For example, when I need to install it on Ubuntu 10.10, I do this:
sudo apt-add-repository ppa:rhonda/pgadmin3
sudo apt-get update
sudo apt-get install pgadmin3