Questions tagged [postgresql]

PostgreSQL is a powerful, open source object-relational database system.

PostgreSQL offers many advantages for your company or business over other database systems.

666 questions
200
votes
8 answers

How do I find the path to pg_hba.conf from the shell?

I would like to obtain the path to pg_hba.conf from the shell. The path varies between versions of PostgreSQL. For instance, for 8.4 and 9.1: /etc/postgresql/8.4/main/pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf I have tried the pg_config…
Roger Dahl
  • 2,192
147
votes
3 answers

How to install psql without Postgres?

I need the psql command line tools, but I don't need the actual Postgres RDBMS. This is to work with a package which supports a psql interface. Is it possible to install just psql? (Ubuntu 16.04)
113
votes
27 answers

Can not connect to PostgreSQL listening on port 5432

I installed the Bitnami Django stack which included PostgreSQL 8.4. When I run psql -U postgres I get the following error: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections…
Assaf Lavie
  • 2,183
53
votes
3 answers

pg_ctl: command not found, what package has this command?

I have installed pgadmin using the ubuntu software center and am trying to access a local database (recently downloaded from the internet). I have tried to run the pg_ctl command (running as postgres) however this gives a command not found error. I…
Thijser
  • 1,061
  • 2
  • 14
  • 38
47
votes
4 answers

how to nicely stop all postgres processes

How do you nicely stop all postgres processes with pg_ctl (or otherwise), when you don't recall what the database directory is, nor have the PGDATA environment variable defined?
matanox
  • 2,293
36
votes
1 answer

Postgres doesn't have hstore extension

I was trying to run the following command but i threw me any error. template1=# CREATE EXTENSION hstore ERROR: could not open extension control file "usr/share/postgreesql/9.2/extension/hstore.control": No such file or directory It seems like I…
CYC0616
  • 463
34
votes
4 answers

How to make Postgres start automatically on boot

I am new to Ubuntu and I would like to know how to make postgresql start automatically on boot and how to configure my setup so that I can start the postgres server if need be. I am working on a small rails project and I have been having…
cwmacken
  • 483
  • 1
  • 4
  • 8
27
votes
3 answers

How do I migrate my postgres data from 8.4 to 9.1?

I have upgraded my ubuntu development machine from 11.04 to 11.10. In the process my postgres was also upgraded from 8.4 to 9.1. But I seem to have lost all my data. If I look, I can see that my data for 8.4 is in folder /var/lib/postgres/8.4/main…
nathanvda
  • 1,593
27
votes
5 answers

How to stop postgres from autostarting during start up

I have postgresql 8.4 installed on my desktop. It keeps starting on bootup because I think I used default settings. so I issue /etc/init.d/postgresql stop everytime and sometimes i keep forgetting It has folder paths…
bcrawl
  • 273
25
votes
3 answers

How do I solve a "server version mismatch" with pg_dump when I need BOTH PostgreSQL servers installed?

I installed two PostgreSQL servers in my computer. One is 9.1 and the other is 9.3. I need both servers installed. When I run pg_dump, however, I get a version mismatch error: server version: 9.3.6; pg_dump version: 9.1.15 pg_dump: aborting because…
Luis Masuelli
  • 502
  • 3
  • 7
  • 12
22
votes
11 answers

Postgresql server doesn't start

[Ubuntu 16.04] I installed postgresql 9.5 along with dependencies: sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list" wget --quiet -O -…
mike927
  • 333
22
votes
4 answers

How install postgresql 9.4

After trying apt-get install postgresql-9.4, updating, trying again etc etc. It seems I can't install it: Couldn't find any package by regex 'postgresql-9.4' I know there is a similar question in askubuntu but the answer there doesn't work…
alejoss
  • 479
17
votes
3 answers

How do I upgrade to Postgres 9.2?

Just recently, I've read that PostgreSQL 9.2 is released. My Ubuntu 12.04 has PostgreSQL 9.1.5 installed. How can I update to 9.2 version? I tried apt-get update and apt-get upgrade but no updates for PostgreSQL.
Defensor
  • 360
16
votes
4 answers

psql command "Error: PostgreSQL version 12 is not installed"

I have installed PostgreSQL 11 but for some reason when I type psql in the terminal I get PostgreSQL version 12 is not installed error Recently I uninstalled a PostgreSQL server so I think I didn't do it well How could I get psql command exec…
Berre
  • 163
15
votes
3 answers

How to start PostgreSql

When I am running this command below: sudo -u postgres psq I get this error message below: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket…
Jonte YH
  • 1,961
1
2 3 4 5 6 7