ubuntu guys: most likely your pg_restore is outdated. Just use postgres doc and install newest version of postgres:
-
Create the file
/etc/apt/sources.list.d/pgdg.listand add a line for the repository:deb http://apt.postgresql.org/pub/repos/apt/ YOUR_UBUNTU_VERSION_HERE-pgdg mainwhere ubuntu versions are:- 20.04 – focal
- 18.04 – bionic
- 16.04 – xenial
-
Add keys:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - -
sudo apt-get update && sudo apt-get upgrade
It worked for me!