User postgres can't write to /var/lib/postgresql

Bug #1334714 reported by Todd Decker
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Unable to write to history log. Seems to be the same problem as bug 32696 which was marked as fixed back in 2006. But, it happens to me too after straight postgress installation on an Ubuntu 14.04 Amazon EC2 instance.

Steps taken to install:

<Stand up EC2 instance>

$ sudo apt-get install postgresql postgresql-contrib

$ sudo apt-get install pgadmin3

Problem occurs:

ubuntu@ip-172-31-20-201:~$ sudo -u postgres psql postgres
psql (9.3.4)
Type "help" for help.

postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
could not save history to file "/var/lib/postgresql/.psql_history": No such file or directory

<ctrl-d>

Listing of /var/lib/postgresql directory:

ubuntu@ip-172-31-20-201:~$ ls -al /var/lib/postgresql
total 16
drwxr-xr-x 3 postgres postgres 4096 Jun 26 14:58 .
drwxr-xr-x 41 root root 4096 Jun 26 14:54 ..
drwxr-xr-x 3 postgres postgres 4096 Jun 26 14:54 9.3
-rw------- 1 postgres postgres 19 Jun 26 14:58 .psql_history

Diagnostics

ubuntu@ip-172-31-20-201:~$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04

ubuntu@ip-172-31-20-201:~$ apt-cache policy postgresql
postgresql:
  Installed: 9.3+154
  Candidate: 9.3+154
  Version table:
 *** 9.3+154 0
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in postgresql-common (Ubuntu):
status: New → Confirmed
Revision history for this message
Phil (philip-olson-m) wrote :

Same issue - not EC2 instance but home server with default install of postgresql

Diagnostics

Description: Ubuntu 14.04.1 LTS
Release: 14.04

postgresql:
  Installed: 9.3+154
  Candidate: 9.3+154
  Version table:
*** 9.3+154 0
  500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
  100 /var/lib/dpkg/status

Revision history for this message
Maria Vargas (melocoton) wrote :

You need to modify /etc/passwd.
Put the location of your pgsql folder on postgres line and try :
grep postgres /etc/passwd | cut -d ':' -f 6

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.