Questions tagged [postgresql]

PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) available for many platforms including Linux, FreeBSD, Solaris, Microsoft Windows and Mac OS X.

Filter by
Sorted by
Tagged with
88
votes
4answers
227k views

Command to list PostgreSQL user accounts?

There are createuser & dropuser commands: createuser - define a new PostgreSQL user account dropuser - remove a PostgreSQL user account Is there a corresponding way to list the user accounts? ...
49
votes
1answer
84k views

Install PostgreSQL client (psql) only on CentOS

Simple question, but no resources found about this. Is there any way to install only a PostgreSQL client, the terminal-based one, psql, on a CentOS7 system, without installing the complete PostgreSQL ...
27
votes
3answers
68k views

Couldn't find postgresql.conf & pg_hba.conf files in my postgresql installation

Following all the instructions from UNIXMEN, installed postgresql-9.4 in CentOS 6.4. Everything went well, started the service and could access pgsql screen. But when I try to configure the phpPgAdmin,...
14
votes
3answers
30k views

Systemd postgresql start script

I'm in the process of installing postgresql onto a second server Previously I installed postgresql and then used the supplied script ./contrib/start-scripts/linux Placed into the correct dir # cp ....
13
votes
1answer
1k views

Why does `postgres` require a shell?

In my Debian Wheezy systems, I noticed that the postgres user 'postgres', the "PostgreSQL administrator", uses /bin/bash as shell. However, I cannot figure out why this is needed. Changing this to /...
9
votes
2answers
8k views

What network protocols does a Postgres database server use?

I have a postgres 9.1 server running on the default port 5432 on an Ubuntu 12.04 cloud server. I want to open up the port, so I can make remote queries -- but I have to open the port on IP tables, ...
8
votes
5answers
22k views

pg_dump version mismatch on Debian

I'm running PostgreSQL on Debian Unstable/Sid. I've got the current versions (9.1) of postgresql, postgresql-client, postgresql-client-common (143) installed. The problem I'm having is trying to run ...
6
votes
4answers
3k views

Choosing Linux Distro for PostgreSQL

I need a new PostgreSQL 9.1 machine. My go to distro is Debian (for no good reason other than it's what I first learned). However, when I started looking at documentation, it appears that Debian ...
6
votes
4answers
37k views

“psql: could not connect to server: No such file or directory”

Actually, I installed PostgreSQL 9.4 (with postGIS extension), and when installed, everything used to work fine. As said on many tuts, I've set the /data folder, checked configuration files, and so ...
6
votes
1answer
974 views

How do I configure postgres's authorization settings in nixos?

On nixos, I face a postgres error psql: FATAL: Peer authentication failed for user "postgres" similar error to this question, and would like to edit the authentication settings to resolve the issue ...
6
votes
3answers
1k views

Passwords for newly created users?

I am fairly new to Linux and I have question regarding users. When I use the useradd command I don't specify a password. I must use the passwd command afterwards. Does this mean that the user is ...
6
votes
3answers
668 views

How can I build and install PL/R as a non-privileged user?

There is a postgres instance, and I have the ability to build my own instance. Using these instructions I ran: USE_PGXS=1 make which worked but then USE_PGXS=1 make install did not, with this ...
5
votes
3answers
43k views

How do you stop posgresql on centos 7?

How does one stop a Postgresql instance, 9.2, on CentOS 7. I found nothing under /etc/init.d/ nor a ctl program.
5
votes
3answers
23k views

Unable to start posgtresql, the reason isn't clear

I've installed postgresql by pacman. Now I'm trying to run it: $ sudo systemctl start postgresql Job for postgresql.service failed because the control process exited with error code. See "...
5
votes
1answer
997 views

unable to connect to forwarded port over ssh

I have two servers. Server 1 has access to an Oracle instance on a server I have permission to hit but not login to via SSH. I would like to use SSH port forwarding to connect from server 2 to server ...
4
votes
1answer
4k views

How to save psql error message output in bash variable?

I have a script that runs several different psql statements. I'm trying to capture the error output from psql when password entered is incorrect. The password is entered in before the check (and when ...
4
votes
1answer
3k views

PostgreSQL: too many connections for role “rep” on slave server

I tried to setup "master - 2 slaves" configuration by article on digitalocean (https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-...
4
votes
2answers
4k views

how to split long psql command in bash script over several lines

I have a long psql command to execute within a bash shell script, and I am wondering what the correct way is to split it across several lines? The standard Unix script 'split line' backslash ...
4
votes
2answers
4k views

Logic behind Postgres binary installation path on Debian

It appears that the Postgresql installation is split into three folder locations on Debian: Configuration: /etc/postgresql Binaries: /usr/lib/postgresql Data: /var/lib/postgresql I ...
4
votes
1answer
1k views

How do I pg_upgrade my database on Arch Linux?

I was running postgres 8.4 on arch but now have 9 installed I want to use pg_upgrade to upgrade but I don't know what all the options I have to use are, and all the directories that I have to point it ...
4
votes
1answer
4k views

How to install PostgreSQL 9.3 in FreeBSD jail?

I configured virtual NICS using pf, and a jail for FreeBSD using qjail create pgsql-jail 192.168.0.3. When I tried to install PostgreSQL 9.3 using port collection, it shows strange message at first. ...
3
votes
3answers
8k views

How to solve the problem of PostgreSQL service doesn't start?

This is about Metasploit Framework. root@kali:~# service postgresql start [....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log ...
3
votes
1answer
2k views

Copy csv data while simultaneously filling serial column

I've created my first postgres table and i'm trying to work out how to copy a .csv file into the table, whilst simultaneously generating a serial number number in column 1 (ID) which starts at number ...
3
votes
1answer
2k views

What does exit code 130 mean for postgres command?

When attempting to start PostgreSQL server using the /usr/pgsql-9.2/bin/postgres command I get an exit value code of 130. However I could not find any documentation for the exit codes of this command....
3
votes
1answer
999 views

Authentication not working in Dovecot and PostgreSQL

I want to put my own mail server on VPS using Postfix, Dovecot, LMTP and PostgreSQL database. I can't send messages from VPS using the mail command, ie I don't receive these emails at my replacement ...
3
votes
1answer
2k views

Encrypt postgresql database

I am reading the postgresql database documentation, but I can't found nothing about encrypting the database files to prevent someone to see the data without the database password. There is some way to ...
3
votes
2answers
5k views

Incremental backup of postgresql database

We run a database server running PostgreSQL with database size of around 130GB growing at a rate of 500MB per day. We use HP Data Protector software to take backups of the database. The issue here is ...
3
votes
1answer
8k views

How to change the path of shared libraries shown by ldd?

I am trying to make the postgis extension work on my system and it always spits out "$libdir/postgis2.2" no such file or directory error. For my curiosity I executed "ldd postgis-2.2.so" and it spits ...
3
votes
1answer
892 views

Stop a process from running on startup without removing it

Just for the heck of it I was running pgrep postgres and got a ton of results: postgres 1882 1 0 10:06 ? 00:00:00 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c ...
3
votes
2answers
1k views

Simulate PostgreSQL query timeout

I would like to test the behaviour of a program which executes queries to a PostgreSQL server in case of a query timeout. How could I simulate that?
3
votes
1answer
1k views

Upgrade Minor Version of Postgres in Debian using apt

I'm trying to move from 9.1.3 to 9.1.4. I thought all I had to do was "apt-get update" and "apt-get upgrade", but that didn't work. It did install some updates, but that was only for 9.1.3. Any ...
3
votes
2answers
7k views

sudo yum install postgresql doesn't work on CentOS 7?

I'm trying to install PostgreSQL on CentOS 7 (by following this guide to install Discourse) but when I give this command: sudo yum install postgresql91-server.x86_64 postgresql91-contrib.x86_64 ...
3
votes
2answers
4k views

Saving all incoming messages into a database with Postfix?

Is there some plugin for Postfix that can allow you to save all incoming messages into a relational database (PostgreSQL)?
3
votes
1answer
2k views

Is it possible to import vmail folder from old iRedMail to new iRedMail installation?

Basically, what I did: Copied vmail folder to my local machine. Reinstalled my VPS. Installed iRedMail again. Created same users on the same domain. Question is - can I somehow copy over my old ...
3
votes
0answers
254 views

Cannot install postgis2_94 on Centos 7.5

I am trying to install postgis2_94 on CentOS 7.5 with the following command (having already installed postgresql94 ): yum install postgresql94-server postgresql94-devel postgis2_94 postgis2_94-...
3
votes
0answers
2k views

Failed to start PostgreSQL database server. — all of the sudden [closed]

All of the sudden postgresql has broken down: $ sudo systemctl status postgresql ● postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; ...
2
votes
3answers
3k views

Postgres: authenticate as postgres user in non-interactive script

I am writing a non-interactive script that needs to execute postgres commands. The script will only be run by root or a user with sudo permissions, and the postgres commands need to be executed as ...
2
votes
1answer
43 views

Unable to start postgres unless I type the command to restart it

Whenever I try to start my project the following error occurs. django.db.utils.OperationalError: could not connect to server: No such file or directory Is the server running locally and ...
2
votes
1answer
7k views

Cannot telnet to private IP or to port

What specific changes need to be made so that a CentOS 7 installation at local IP 192.168.1.6 can telnet to another CentOS 7 installation at another local IP 192.168.1.5? As you can see, 192.168.1....
2
votes
3answers
12k views

CentOS 5: My Postgresql server version is different with my psql client. What should I do?

I installed PostgreSQL 9.1 in CentOS 5 x86_64 VPS, with these following commands: I specified which Postgresql version I'd like to install, so I choose 9.1 because I want to equate between ...
2
votes
2answers
5k views

Can't install PostgreSQL 9.2 on Linux Mint

I'm new with Linux systems. I tried to install PostgreSQL 9.2. I did the following: sudo apt-get update sudo apt-get -y install python-software-properties sudo add-apt-repository ppa:pitti/postgresql ...
2
votes
1answer
3k views

Unable to locate package postgresql-server-dev?

I am trying to install the following packcage postgresql-server-dev-9.5. Using sudo apt-get install postgresql-server-dev-9.5 Now, after I run this command I get this error: Unable to locate ...
2
votes
1answer
1k views

Cron : Why are my cron scripts not running even though cron is running

I have a 4 scripts to transfer database from one server to other for testing purpose. These scripts execute automatically in the night. When I call the scripts manually, I get no error, but without ...
2
votes
1answer
596 views

/etc/rc.d/postgres start vs rc.d postgres start

What's the difference between those two commands? /etc/rc.d/postgres start and rc.d postgres start Aren't those interchangeable? I tried starting PostgreSQL using the latter, but it only works ...
2
votes
1answer
25 views

Does 'sudo apt-get purge postgr*' remove database files?

I ran sudo -u postgres psql -c "show data_directory" and it shows /var/lib/postgresql/9.5/main. If I understand correctly, this is the directory that stores the database files. I ran sudo apt-get ...
2
votes
2answers
245 views

Using systemd I want my Postgresql ExecStop command to run at shutdown

I have a set of scripts that run constantly while Postgresql is up. I modified the ExecStop commands in my .service file so that a special script to stop those scripts and wait for them to complete ...
2
votes
1answer
8k views

How to install pgAdmin 4 on Linux Mint

I'm running Linux Mint 19 Tara, and trying to follow the instructions here with the goal of installing pgAdmin4 as a desktop app. There seems to be a problem involving the authentication of the ...
2
votes
1answer
54 views

Dumping postgres DBs into separate files

I inherited a postgres DB (which I have very little experience with) and trying to figure out a way to dump/back it up. I've been reading docs about it and can get as far as dumping the DBs into ...
2
votes
1answer
320 views

Server upgrade (yum update) removed psql local installation

I have installed locally a PostgreSQL server 9.6.2 on aws Centos server a while ago using these commands: rpm -i https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-...
2
votes
2answers
6k views

initdb: cannot be run as root

I want to create a database cluster in PostgSQL on CentOS. When I type the command 'initdb', the result goes like the following: [root@cll agensgraph]# initdb initdb: cannot be run as root Please ...