pg_dump: error: server version: 14.5; pg_dump version: 13.10 (Debian 13.10-0+deb11u1)

function install_pg_dump_14 {
  #pg_dump might be mismatched
  #make sure this gets ran in django container
  echo "yes" | apt update
  echo "yes" | apt install vim curl wget gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates
  echo "yes" | apt policy postgresql
  curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc| gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
  sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
  echo "yes" | apt update
  echo "yes" | apt install postgresql-14
  rm -rf /usr/bin/pg_dump
  ln -s /usr/lib/postgresql/14/bin/pg_dump /usr/bin/pg_dump
}

Leave a Reply

Your email address will not be published.