Help needed: Reverting Octopi PostgreSQL update


#1

Hi there,

I’m a new Manjaro user. I’ve ignored Octopi notifications about available updates for long. But yesterday I decided to install all of the available 600 updates.

I accidentally updated PostgreSQL to v11. However, before this I used version 10 and would like to continue using it.

When I’m loading Manjaro, now I’m always getting warnings about how my PostgreSQL is failing.
I tried researching on https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL. But the wiki page discusses only good upgrading practices, but doesn’t say a word about downgrading.

This is my status from systemctl.

~ >>> systemctl status postgresql.service                                                                          
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2019-02-22 12:11:03 EET; 2min 12s ago
  Process: 536 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=1/FAILURE)

Feb 22 12:11:03 manjaro systemd[1]: Starting PostgreSQL database server...
Feb 22 12:11:03 manjaro postgres[536]: An old version of the database format was found.
Feb 22 12:11:03 manjaro postgres[536]: See 
https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL
Feb 22 12:11:03 manjaro systemd[1]: postgresql.service: Control process exited, code=exited, 
status=1/FAILURE
Feb 22 12:11:03 manjaro systemd[1]: postgresql.service: Failed with result 'exit-code'.
Feb 22 12:11:03 manjaro systemd[1]: Failed to start PostgreSQL database server.

Would appreciate any help with reverting back to PostgreSQL v10.


#2

Partial upgrades are not supported.

In lieu of recent events I suggest you go to TTY (CTRL+ALT+F2) for the following:

sudo pacman-mirrors -f && sudo pacman -Syyuu

systemctl reboot

Now … how do you services work?


#3

Something you might want to consider in the future is running PostgreSQL as a docker image: https://hub.docker.com/_/postgres Makes it a little easier to keep docker at a particular version without screwing with your system. But if you haven’t used docker before you’d need to learn all about that.

To just downgrade postgresql you can try:

pacman -U /var/cache/pacman/pkg/ *package* - *old_version* .pkg.tar.xz

from: https://wiki.archlinux.org/index.php/downgrading_packages


#4

Welcome

First lesson - don’t ignore update for more than a couple of days.

That is what happens when you ignore it for too long

That is no accident - but a requirement of rolling release.

You better read this on how to do system maintenance on a Manjaro system

https://wiki.manjaro.org/index.php?title=System_Maintenance

Powertip: With a huge amount of updates use one of the below methods

  • switch to a TTY
    (use Ctrl+Alt+F1…F6)
  • boot to CLI using the edit grub facility at the loader screen.
    (adding a three (3) to the chosen grub commandline will boot to CLI)

#5

One thing I probably should also mention is I’ve done the postgresql upgrades described in https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL and it worked without any issues.


#6

Second the docker container suggestion if you absolutely require a certain version.

Rolling release distros live up to their name … they roll … nothing stays still for long.


#7

Thank you everyone!
I just followed the guidelines on upgrading PostgreSQL from wiki.archlinux.org and everything turnt out very well. Somehow the article became a lot clearer after a second read after a day haha.
Definitely gonna learn more about System Maintenance, Manjaro, and inner workings of PostgreSQL.
@sueridgepipe considering learning Docker in the near future.

Thank you everyone again. It’s so nice to have such a helpful and supportive community.


closed #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.