Questions tagged [postgresql]

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

Filter by
Sorted by
Tagged with
200 votes
8 answers
742k views

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/...
Roger Dahl's user avatar
  • 2,192
165 votes
5 answers
676k views

How to remove Postgres from my installation?

I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but ...
devasia2112's user avatar
  • 1,809
149 votes
3 answers
171k views

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)
Steve Bennett's user avatar
119 votes
4 answers
273k views

How to install pgAdmin 4 in desktop mode on Ubuntu

How to install pgAdmin 4 in desktop mode? The documentation only details server mode.
Victor's user avatar
  • 9,313
113 votes
27 answers
605k views

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 ...
Assaf Lavie's user avatar
  • 2,183
99 votes
4 answers
185k views

How do I install PostgreSQL 9.6 on any Ubuntu version?

How do I install PostgreSQL 9.6 on any Ubuntu version since it doesn't come by default with the most recent version? Ubuntu Xenial (16.04) comes with PostgreSQL 9.5 from the default repositories.
Victor's user avatar
  • 9,313
93 votes
7 answers
131k views

What is the difference between "service restart" and "service reload"

I'm trying to understand the difference between service restart [someservice] and service reload [someservice]. I understand that restart restarts the service whereas reload reloads the configuration. ...
nxzr's user avatar
  • 1,033
57 votes
6 answers
181k views

Remotely access postgresql database

I need to access a postgresql database from a remote machine on a VPS at DigitalOcean running 12.10 and postgresql 9.1. How do I do this? I noticed port 5432 is closed, how do I open this?
Øyvind 's user avatar
57 votes
2 answers
182k views

Command pg_dump not found?

I was trying to make a backup in a server and I got the error: pg_dump command not found I thought that if you had postgres installed, it worked. What I have to do to install this command? I do not ...
forvas's user avatar
  • 775
54 votes
3 answers
173k views

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) ...
Thijser's user avatar
  • 1,071
50 votes
4 answers
147k views

What is a masked service?

I would like to understand what a masked service is and how to unmask it if need be. I have been trying to start PostgreSQL on Ubuntu 16.04-LTS using the command systemctl start postgresql.service. ...
Joseph-L-S's user avatar
  • 1,063
47 votes
3 answers
296k views

Postgres password authentication fails

I've installed PostgreSQL 9.1 and pgadmin3 on Ubuntu Server 13.10. I configured postgresql.conf with: listen_addresses = '*' also I configured ph_hba.conf by changed peer connections to md5 Plus I ...
Shadin's user avatar
  • 1,227
47 votes
4 answers
162k views

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's user avatar
  • 2,293
42 votes
4 answers
107k views

Stopping a postgresql instance

For the sake of educational purposes I have two identical instances of postgresql running on my machine. I can easily stop the service of the instance that is running on port 5432 like this : sudo ...
Beatles1692's user avatar
36 votes
1 answer
29k views

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....
CYC0616's user avatar
  • 463
34 votes
4 answers
92k views

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 ...
cwmacken's user avatar
  • 483
33 votes
3 answers
51k views

How do I set which PostgreSQL version is to be used by default?

I have 2 different versions of PostgreSQL installed on my system (Ubuntu Lucid): /var/lib/postgresql/8.4 /var/lib/postgresql/9.0 By default, when I run a PostgreSQL command such as createdb or psql, ...
coffee-grinder's user avatar
28 votes
2 answers
65k views

Where is a postgresql 9.1 database stored in ubuntu 12.04?

I installed and created a Postgresql database on ubuntu. I then created the database using the following command: sudo su postgres createdb mydatabase However, I can't figure out where the database ...
celenius's user avatar
  • 387
27 votes
4 answers
173k views

How do I install pgAdmin III for postgreSQL 9.2?

I have a Windows server that runs postgresql 9.2. I want to hit it using pgAdmin III from my Ubuntu 12.10 workstation box. I installed pgAdmin III from synaptic and also tried direct download from ...
Vector's user avatar
  • 781
27 votes
5 answers
34k views

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 ...
bcrawl's user avatar
  • 273
27 votes
3 answers
30k views

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 ...
nathanvda's user avatar
  • 1,593
27 votes
4 answers
20k views

After upgrade 14.04 to 16.04.1 Postgresql server does not start

Just upgraded my system from 14.04. LTS to 16.04.1 LTS, postgresql does not start on systemd: /etc/init.d/postgresql start ...
Artur Eshenbrener's user avatar
25 votes
3 answers
123k views

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; ...
Luis Masuelli's user avatar
23 votes
5 answers
90k views

Uninstall an specific version of PostgreSQL

I have Postgresql 9.1.1 in my Ubuntu 12.04 which got installed due to automatic upgrades and whenever I uninstall it using the command: sudo apt-get --purge remove postgresql-9.1.1 I get an error ...
sanjeeda's user avatar
  • 311
23 votes
1 answer
20k views

Skipping acquire of configured file in ubuntu 20.04 LTS [duplicate]

I have recently updated to Ubuntu 20.04 and I am a bit fresh user for ubuntu. after installing postgresql 12 I ran sudo apt-get update it says N: Skipping acquire of configured file 'main/binary-i386/...
NewUser's user avatar
  • 333
23 votes
4 answers
39k views

How to install PostgreSQL 13 in Ubuntu?

How to install PostgreSQL-13 in Ubuntu 20.04?
Thirumal's user avatar
  • 989
23 votes
1 answer
85k views

default location of postgresql when installing through apt-get

When you install postgresql on 14.04, it sticks the main server program postgres at: /usr/lib/postgresql/9.3/bin/postgres the data directory where all the database clusters will be stored at: /var/...
Donato's user avatar
  • 583
22 votes
4 answers
59k views

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 ...
alejoss's user avatar
  • 479
22 votes
11 answers
119k views

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 --...
mike927's user avatar
  • 333
22 votes
5 answers
134k views

How to enable PostgreSQL driver for PDO for php 7?

I have a ubuntu 14.4 server with apache2 and php 7.1.6. I also have PostgreSQL 9.3 installed on it. I now need to connect to this data from php code, using PDO. I have tried the following: Install ...
Devdatta Tengshe's user avatar
21 votes
5 answers
75k views

Install postgresql. Why is initdb unavailable?

I'm following these instructions, however I can only get to step 17.2. Despite installing postgresql successfully via the sudo apt-get install postgresql command, upon running initdb -D /usr/...
Starkers's user avatar
  • 3,079
19 votes
3 answers
51k views

Can't install pgAdmin 4 on 20.04 LTS

Basically, follow the steps as outlined here: https://wiki.postgresql.org/wiki/Apt. sudo apt-get install curl ca-certificates gnupg curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-...
cjones's user avatar
  • 457
18 votes
8 answers
39k views

How to install PostgreSQL on Ubuntu 13.04?

How to install PostgreSQL in Ubuntu 13.04? I followed by this tutorial, How to install postgreSQL 9-2 - UbuntuGeek.com But in logs it says: the package is deprecated and no longer will be used ...
Daler's user avatar
  • 283
18 votes
5 answers
37k views

Problem Installing and configuring PostgreSQL

I am a newbie here and to the server administration. A couple of days back I have registered a server with Hetzner with Ubuntu 11.04. I intend to work with PostgreSQL, for which I have installed ...
Syed Aslam's user avatar
18 votes
2 answers
59k views

Unable to install postgreSQL 9.6 in Ubuntu 18.04

I'm trying to install postgreSQL 9.6 in Ubuntu 18.04 via Ubuntu Software Centre and type from terminal sudo apt-get install postgresql-9.6 according to official documentation https://www....
webtechnelson's user avatar
18 votes
2 answers
38k views

How to fix PostgreSQL installation

I upgraded from Maverick to Natty recently and everything went fine except during the dist-upgrade something went wrong with PostgreSQL. I've since tried reinstalling, removing, and even purging it ...
wired's user avatar
  • 183
17 votes
3 answers
41k views

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 ...
Defensor's user avatar
  • 360
17 votes
4 answers
14k views

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 ...
Berre's user avatar
  • 173
17 votes
1 answer
53k views

Peer authentication failed for user with all privileges in Postgres 9.5

I want to create a user who only has access to a specified database. However, it should have all permission. I use Postgresql 9.5 on Ubuntu 14.04. So first of all, I create a new user: $createuser --...
Qeychon's user avatar
  • 285
16 votes
4 answers
34k views

PHPPgAdmin not working in Ubuntu 14.04

After a fresh install of Ubuntu 14.04, I've installed postgresql and phppgadmin from the Ubuntu repos. I am using the Apache2 webserver. PHP is working fine in the webserver, as is PHPMyAdmin, but ...
Adam's user avatar
  • 524
16 votes
3 answers
42k views

can not install libpq-dev in ubuntu 14.04

I can not install libpq-dev for postgresql, i tried sudo apt-get install libpq-dev and output Building dependency tree Reading state information... Done Some packages could not be installed. ...
indra bin ridwan's user avatar
16 votes
2 answers
48k views

Problems installing postgresql-9.4: Unable to locate package

I'm using Ubuntu 14.04. I'm trying to download postgresql using this guide. But when I run the command sudo apt-get install postgresql-9.4 in my terminal, I get this error message: E: Unable to ...
Joe Morano's user avatar
16 votes
5 answers
41k views

Postgresql server not started in ubuntu 14.04

My problem is after postgresql installed try to configure postgresql database it's show error message like below: dineshlap@ss-laptop:~$ sudo -u postgres psql postgres psql: could not connect to ...
Dinesh's user avatar
  • 281
15 votes
2 answers
24k views

How to uninstall specific versions of Postgres?

On Ubuntu 14.04 I have done this to get the latest postgres: sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget -...
Houman's user avatar
  • 975
15 votes
3 answers
86k views

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 ...
Jonte YH's user avatar
  • 1,961
14 votes
3 answers
16k views

How do I create Unicode databases in PostgreSQL 8.4?

I installed the postgresql-8.4 package with default options. Everything worked fine, however I can't seem to manage to create unicode databases: -- This doesn't work createdb test1 --encoding UNICODE ...
wildpeaks's user avatar
  • 285
14 votes
3 answers
7k views

Why is there a shell given to user for PostgreSQL?

cat /etc/passwd |grep postgre postgres:x:115:127:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash apt-cache show postgresql Package: postgresql Priority: optional Section: database ...
Smile.Hunter's user avatar
  • 8,355
13 votes
2 answers
15k views

rails & libpq-dev nasty dependencies

I don't know if this question belongs here, but I'll take a shot. Hi. I'm running ubuntu 11.10 dual-boot with windows vista on my machine. On Ubuntu, I've installed RVM, rails gem, & PostgreSQL (...
PatrixCR's user avatar
  • 365
13 votes
3 answers
71k views

How to install pgAdmin 4 in server mode on Ubuntu 16.04

How to install pgAdmin 4 on Ubuntu 16.04 ? Lack of information on homepage. https://www.pgadmin.org/ https://www.postgresql.org/ftp/pgadmin3/pgadmin4/
Jiří Doubravský's user avatar
13 votes
5 answers
81k views

"postgres: command not found" / after regular install of postgres and configure new data directory

I am setting up a POSTGRESQL on a UBUNTU 16.04 server: I followed the explanation given here, I did: The install: sudo apt-get install postgresql postgresql-contrib` The setup of postgres user and ...
nyluje's user avatar
  • 329

1
2 3 4 5
14