0

UPDATE

Why I run "sudo apt-get purge postgresql-9.4 postgresql-client-9.5 postgresql-client-common postgresql-common" and everything is OK???

My ubuntu is 12.04.1. Does it matter with this?


I have one postgresql-9.3.4 running on the machine. bin files are in /opt/pkgs/postgresql-9.3.4:

#tree /opt/pkgs/postgresql-9.3.4/bin
/opt/pkgs/postgresql-9.3.4/bin
├── clusterdb
├── configure
├── createdb
├── createlang
├── create-ssl-certs
├── createuser
├── dropdb
├── droplang
├── dropuser
├── ecpg
├── initdb
├── pg_basebackup
├── pg_config
├── pg_controldata
├── pg_ctl
├── pg_dump
├── pg_dumpall
├── pg_isready
├── pg_receivexlog
├── pg_resetxlog
├── pg_restore
├── postgres
├── postmaster -> postgres
├── psql
├── reindexdb
└── vacuumdb

Now, I am going to run "apt-get install postgresql" to install postgresql-9/5. Output:

Adding user postgres to group ssl-cert

Creating config file /etc/postgresql-common/createcluster.conf with new version

Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
 * No PostgreSQL clusters exist; see "man pg_createcluster"
Setting up postgresql-9.5 (9.5.0-1.pgdg12.4+2) ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Creating new cluster 9.5/main ...
  config /etc/postgresql/9.5/main
  data   /var/lib/postgresql/9.5/main
  locale en_CA.UTF-8
  socket /var/run/postgresql
  port   5433
update-alternatives: using /usr/share/postgresql/9.5/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
 * Starting PostgreSQL 9.5 database server
 * The PostgreSQL server failed to start. Please check the log output:
2016-01-20 15:49:52 UTC [16601-1] LOG:  database system was shut down at 2016-01-20 15:49:51 UTC
2016-01-20 15:49:52 UTC [16601-2] LOG:  MultiXact member wraparound protections are now enabled
2016-01-20 15:49:52 UTC [16605-1] LOG:  autovacuum launcher started
2016-01-20 15:49:52 UTC [16600-1] LOG:  database system is ready to accept connections
2016-01-20 15:49:52 UTC [16607-1] [unknown]@[unknown] LOG:  incomplete startup packet
   ...fail!
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-9.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.5; however:
  Package postgresql-9.5 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
No apport report written because the error message indicates its a followup error from a previous failure.
ldconfig deferred processing now taking place
Errors were encountered while processing:
 postgresql-9.5
 postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)

And status is OK:

me@cyc:/opt/$ sudo service postgresql start
 * Starting PostgreSQL 9.5 database server                                                                     [ OK ] 
me@cyc:/opt/$ sudo service postgresql status
9.5/main (port 5433): online

Maybe it has something to do with running postgresql-9.3.4, but no idea why. Anyone gives some hints? Thanks in advance.

By the way, log file:

2016-01-20 17:08:57 UTC [19938-1] LOG:  database system was shut down at 2016-01-20 17:08:35 UTC
2016-01-20 17:08:57 UTC [19938-2] LOG:  MultiXact member wraparound protections are now enabled
2016-01-20 17:08:57 UTC [19937-1] LOG:  database system is ready to accept connections
2016-01-20 17:08:57 UTC [19942-1] LOG:  autovacuum launcher started
2016-01-20 17:08:58 UTC [19944-1] [unknown]@[unknown] LOG:  incomplete startup packet

me@cyc:/usr/lib/postgresql/9.5/bin$ ps aux | grep postgresql

postgres 17652  0.0  4.6 1124308 47660 pts/0   S    16:39   0:00 /opt/pkgs/postgresql-9.3.4/bin/postgres -D /opt/data/postgresql-9.3/data -D /opt/data/postgresql-9.3/data
me 20480  0.0  0.4  47988  4824 pts/1    S+   17:20   0:00 vim postgresql-9.3.4.init.d
postgres 20531  0.0  1.6 244292 16780 ?        S    17:22   0:00 /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf

me@cyc:/usr/lib/postgresql/9.5/bin$ which pg_lsclusters
/usr/bin/pg_lsclusters
me@cyc:/usr/lib/postgresql/9.5/bin$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log file
9.5 main    5533 online postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log

  • Which Linux flavour do you run? Debian, Ubuntu, ...? – ypercubeᵀᴹ Jan 20 '16 at 17:29
  • @ypercubeᵀᴹ ubuntu 12.04 – BAE Jan 20 '16 at 17:30
  • 1
    And the output of pg_lsclusters ? – ypercubeᵀᴹ Jan 20 '16 at 17:31
  • @ypercubeᵀᴹ Please see updated post. – BAE Jan 20 '16 at 17:34
  • Not sure. You say that service postgresql status shows 9.5/main (port 5433): online. But pg_lsclusters shows it's listening on 5533. Can you connect with psql to port 5533? – ypercubeᵀᴹ Jan 20 '16 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.