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.

learn more… | top users | synonyms

20
votes
1answer
27k 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? ...
11
votes
1answer
523 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 /...
6
votes
4answers
2k views

Choosing Linux Distro for PostgreSQL

I'll begin by saying I'm a newbie sys admin. 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 ...
6
votes
3answers
500 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
579 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
2answers
1k 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 ...
5
votes
5answers
12k 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 ...
5
votes
2answers
3k 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. ...
4
votes
1answer
230 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
709 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 ...
3
votes
3answers
5k 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
43 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
2answers
3k 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
2answers
638 views

What network protocols do database servers 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, ...
3
votes
2answers
677 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 ...
3
votes
1answer
613 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 ...
2
votes
1answer
3k 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 ...
2
votes
1answer
362 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....
2
votes
1answer
53 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 ...
2
votes
1answer
4k 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,...
2
votes
1answer
519 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
41 views

Ways to restrict remote user to only access a remote database

I want to be able to setup a remote user that can update a PostgreSQL database on a production server. I have two machines, one is a local server that I use as a command and control system, named ...
2
votes
1answer
32 views

Mount a large squashfs in a way that allows random writes (to a separate filesystem)?

I just received a few-dozen-gigabyte squashfs that contains a PostgreSQL database. In order to be able to conveniently query it, I need to have a write access, which makes it complicated. Is there a ...
2
votes
2answers
83 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 ...
2
votes
1answer
94 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 ...
2
votes
1answer
855 views

cannot start PostgreSQL on OpenBSD 5.4 through rc.d

I've installed the postgresql-server package on OpenBSD 5.4 amd64, and I try starting it through its rc.d script, however, it doesn't look like it's running after that. opti# /etc/rc.d/postgresql ...
2
votes
1answer
2k views

How to write a Shell Script using the condition from a database

Consider this is the condition I need to check select count(*) from nm.table1 where column1 =true; Now it should come out of the db (PostgreSQL) and use IF THEN ELSE LOOP in the Unix Something ...
2
votes
2answers
5k views

postgresql service start issues

I'm attempting to build a box via Fabric on Openstack. Part of the install involves installing and running PostgreSQL. This command works fine: $ sudo service postgresql initdb This command fails:...
2
votes
2answers
485 views

Permanently change permissions of /var/run/postgresql

On Linux Mint 17.0 Cinnamon Edition, I want to use /var/run/postgresql as the unix_socket_directories option for all of my postgres databases. Whenever I run the command pg_ctl -D postgres-data -o '-...
2
votes
1answer
2k views

Postgresql wont start after reboot. Kali linux Raspberry Pi 2 [duplicate]

I have been trying for days to get postgresql to work and it did briefly before a restart. How to I set the correct permissions? This is the error I get when I try to start the service after a reboot. ...
2
votes
1answer
3k views

Kali Linux Postgresql Error

I recently installed kali Linux and keep getting an error code starting metasploit this is the code [...] Starting PostgreSQL 9.1 database server: main [...] Error: could not exec /usr/lib/...
2
votes
1answer
52 views

backup file locally in shell script

This is my crontab: crontab -e 30 5 * * * sh /home/donato/Documents/pg_bak.sh Every day at 5:30am I want to execute a shell script I created called pg_bak.sh. This is the contents of the shell ...
2
votes
1answer
215 views

Command-line editing and wrapping

When entering long queries into the command-line psql, my terminal[1] is not wrapping the input line correctly. Additional charactes wrap back to the left of the screen, but on the same line as the ...
2
votes
1answer
663 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 ...
2
votes
1answer
611 views

Running a query without the OS cache

I want to emulate a client site who doesn't have much caching because they have so much I/O all the time. I want to run a SQL query on my machine (on my VM to be precise) with the same limitations ...
1
vote
4answers
1k views

Releasing a deleted but open log file

my Debian server disk maxed out because of a large postgresql log file and while I have deleted it, it is still held by postgresql. When I restart postgresql I get an error as the disk is full and the ...
1
vote
3answers
661 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 ...
1
vote
1answer
354 views

How do I time how long my pg_restore takes in the command line?

I'm trying to track the amount of time the process takes for when I move around my data and upgrade my web app. From the command line, how would I track the amount of time elapsed from when the ...
1
vote
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 ...
1
vote
2answers
214 views

How do I specify which version of a program to run?

Here's my situation: I have two versions of postgres installed, and with the two versions, come two different psql interactive terminals. One is located at /usr/bin/psql, and starts when I run # ...
1
vote
1answer
45 views

How can I install PostgreSQL and PostGIS on Ubuntu 14.04 and enable remote access over the internet?

I would like to install PostgreSQL and PostGIS on my Ubuntu 14.04 virtual private server that is hosted in a remote datacenter. How can I enable remote access on them?
1
vote
1answer
88 views

File/directory not being deleted?

Please see the screenshot. The image on the left says existing x installation found at /opt/x The image on the right shows the terminal where I attempt to delete the same directory. The terminal on ...
1
vote
2answers
1k views

Centos 7 - Trying to install postgresql (from postgresql.org)

I am trying to install Socorro service on fresh Centos 7 (installed on Amazon ec2). I am following the instructions from the official documentation - Socorro. I installed the PostgreSQL 9.3 RPM ...
1
vote
3answers
3k 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 ...
1
vote
1answer
3k views

Cant get remote access to PostgreSQL

There is PostgreSQL 9.2 in Debian. My /etc/postgresql/9.2/main/postgresql.conf file contains: listen_addresses = '127.0.0.0, 212.49.109.137' password_encryption = on '212.49.109.137' is the IP of ...
1
vote
1answer
1k views

Install postgresql 9.2 on debian wheezy (on virtualbox)

I have virtualbox with Debian Wheezy. I'm trying to install Postgresql 9.2 on it. When I trying do it by this instruction i have next: Reading package lists... Done Building dependency tree Reading ...
1
vote
2answers
154 views

Find all postgresql and mysql databases on a system

Is there a way to find all postgresql and mysql databases on my system? (Perhaps using the find command).
1
vote
1answer
53 views

Chroot Postgresql Error

Currently I'm trying to create the first PostgreSQL 9.5 cluster on Linux deploy android 5.0.2, and it seems to be a shared memory error. FATAL: could not create shared memory segment: Function not ...
1
vote
1answer
95 views

How to debug an Out of memory crash

Recently one of my CentOS6 server crashed because of an Out of memory Error: It seems to be related to the postgres database used by java web-applications (deployed on tomcat). But I cannot find ...
1
vote
1answer
31 views

Basic Hosting Postgresql in Virtualbox + Ubuntu 14.04

I have configured Postgres to accept network connections from anywhere: In pg_hga.conf: host all all 0.0.0.0/0 md5 In postgresql.conf: listen_addresses = '*...