postgresql: Fehler installieren und ausführen von postgresql-9.5

Installierte ich zwei postgresql(s), 9.5 sollte die Verwendung von port 5433, 9.3.4, sollte die Verwendung von port 5432:

me@camb:/usr/lib/postgresql/9.5/bin$ ls -al psql
-rwxr-xr-x 1 root root 564464 Jan  7 14:54 psql
me@camb:/opt/pkgs/postgresql-9.3.4/bin$ ls -al psql 
-rwxr-xr-x 1 root root 405960 Aug  5 18:52 psql
me@camb:/opt/pkgs/postgresql-9.3.4/bin$ cat /etc/group
postgres:x:200:
me@camb:/opt/pkgs/postgresql-9.3.4/bin$ groups postgres
postgres : postgres ssl-cert

Schrieb ich ein Skript zum installieren von postgresql-9,5 und Migration von 9.3.4 auf 9,5

Problem 0: postgresql-9.5 kann nicht starten erfolgreich und warum ist der status online

Ausgabe während der Installation:

 * Starting PostgreSQL 9.5 database server
 * The PostgreSQL server failed to start. Please check the log output:
2016-01-19 19:41:49 UTC [16523-1] LOG:  database system was shut down at 2016-01-19 19:41:48 UTC
2016-01-19 19:41:49 UTC [16523-2] LOG:  MultiXact member wraparound protections are now enabled
2016-01-19 19:41:49 UTC [16522-1] LOG:  database system is ready to accept connections
2016-01-19 19:41:49 UTC [16527-1] LOG:  autovacuum launcher started
2016-01-19 19:41:49 UTC [16529-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)
Error while installing Postgresql-9.5:1

Dann habe ich einige tests:

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

Was tun die oben genannten Fehler?

Übrigens ein weiterer Fehler ist:

ERROR:  role "postgres" already exists

Problem 1: Warum kann ich nicht verwenden /usr/lib/postgresql/9.5/bin/psql zu loginto der Datenbank, aber ich kann dies tun, indem Sie /opt/pkgs/postgresql-9.3.4/bin/psql

me@camb:/usr/lib/postgresql/9.5/bin$ sudo -u postgres /opt/pkgs/postgresql-9.3.4/bin/psql -p 5433 reporting_central postgres
psql (9.3.4, server 9.5.0)
WARNING: psql major version 9.3, server major version 9.5.
         Some psql features might not work.
Type "help" for help.

reporting_central=# \q
me@camb:/usr/lib/postgresql/9.5/bin$ sudo -u postgres /opt/pkgs/postgresql-9.3.4/bin/psql -p 5432 reporting_central postgres
psql (9.3.4)
Type "help" for help.

reporting_central=# \q
me@camb:/usr/lib/postgresql/9.5/bin$ sudo -u postgres /usr/lib/postgresql/9.5/bin/psql -p 5433 reporting_central postgres
/usr/lib/postgresql/9.5/bin/psql: symbol lookup error: /usr/lib/postgresql/9.5/bin/psql: undefined symbol: PQsslInUse
me@camb:/usr/lib/postgresql/9.5/bin$ sudo -u postgres /usr/lib/postgresql/9.5/bin/psql -p 5432 reporting_central postgres
/usr/lib/postgresql/9.5/bin/psql: symbol lookup error: /usr/lib/postgresql/9.5/bin/psql: undefined symbol: PQsslInUse

Ist der Fehler "undefined symbol: PQsslInUse". was bedeutet das? Warum kann ich nicht verwenden /usr/lib/postgresql/9.5/bin/psql zu loginto der Datenbank, aber ich kann dies tun, indem Sie /opt/pkgs/postgresql-9.3.4/bin/psql?

Dank

Durch die Art und Weise, führe ich das folgende zu tun-migration:

sudo -u postgres /opt/pkgs/postgresql-9.3.4/bin/pg_dumpall -p 5432 | sudo -u postgres /opt/pkgs/postgresql-9.3.4/bin/psql -p 5433

Dank

  • Dies ist eine dynamische Bibliothek Problem. Einer der beiden Installationen (die neue) nicht finden können, seine richtigen Bibliotheken. Man könnte ausdrücklich festgelegt LD_LIBRARY_PATH in der Umgebung der shell (und später führen Sie ldconfig mit der richtigen search_paths) BTW: pg_upgrade übernimmt dies ganz automatisch.
  • Könnte so einfach sein wie nicht deinstallieren Sie die Vorherige version von Postgres
InformationsquelleAutor BAE | 2016-01-19
Schreibe einen Kommentar