Difference between revisions of "Talk:PostgreSQL"

From ArchWiki
Jump to: navigation, search
(rm closed x9)
(Suggested update to manual upgrade instructions)
Line 1: Line 1:
 +
I've just (belatedly) updated Postgresql from version 10 to 11, and had a couple of problems.
  
 +
{{ic|pg_upgrade}} failed, and I couldn't see anything that looked like a helpful error message, so I resorted to the manual method as described in section 7.1 of this page.
 +
 +
That initially failed too, but I got it to work by using {{ic|/opt/pgsql-10/bin/pg_dumpall}} instead of just {{ic|pg_dumpall}}.  So the steps I used were:
 +
 +
  # systemctl stop postgresql.service
 +
  # mv /var/lib/postgres/data /var/lib/postgres/olddata
 +
  # mkdir /var/lib/postgres/data
 +
  # chown postgres:postgres /var/lib/postgres/data
 +
  [postgres]$ initdb -D '/var/lib/postgres/data'
 +
  [postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ start
 +
  [postgres]$ /opt/pgsql-10/bin/pg_dumpall -f /tmp/old_backup.sql
 +
  [postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ stop
 +
  # systemctl start postgresql.service
 +
  [postgres]$ psql -f /tmp/old_backup.sql postgres
 +
 +
[[User:ChrisDennis|ChrisDennis]] ([[User talk:ChrisDennis|talk]]) 18:26, 18 November 2018 (UTC)

Revision as of 18:26, 18 November 2018

I've just (belatedly) updated Postgresql from version 10 to 11, and had a couple of problems.

pg_upgrade failed, and I couldn't see anything that looked like a helpful error message, so I resorted to the manual method as described in section 7.1 of this page.

That initially failed too, but I got it to work by using /opt/pgsql-10/bin/pg_dumpall instead of just pg_dumpall. So the steps I used were:

 # systemctl stop postgresql.service
 # mv /var/lib/postgres/data /var/lib/postgres/olddata
 # mkdir /var/lib/postgres/data
 # chown postgres:postgres /var/lib/postgres/data
 [postgres]$ initdb -D '/var/lib/postgres/data'
 [postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ start
 [postgres]$ /opt/pgsql-10/bin/pg_dumpall -f /tmp/old_backup.sql
 [postgres]$ /opt/pgsql-10/bin/pg_ctl -D /var/lib/postgres/olddata/ stop
 # systemctl start postgresql.service
 [postgres]$ psql -f /tmp/old_backup.sql postgres

ChrisDennis (talk) 18:26, 18 November 2018 (UTC)