server version mismatch postgresql pg_dump - postgresql

I'm getting the following error when I'm trying to export my database...
pg_dump: server version: 9.3.1; pg_dump version: 9.1.11
pg_dump: aborting because of server version mismatch
The problem is I cannot update from 9.1.11 to 9.3.1 because of my ubuntu version on my client machine. I'm running Ubuntu 13.04 raring ringtail and as you can see in this distributions link the ultimate postgresql version for ubuntu is 12.04 precise pangolin.
Any possible solution? Thanks in advance!

As previously commented the solution is to use a pg_dump compatible with the server version. The alternatives are:
Run pg_dump from the server. This means you have to have a local or remote connection to server (via ssh for example)
Install later version of pg_dump. Note that even pgAdmin includes pg_dump so you don't necessarily have to install PostgreSQL package on the client.

Related

Upgrade psql on Mac OS - Mismatching client and server versions. Some psql features might not work

I have just upgraded to PostgreSQL 10.11 on macOS using Homebrew and I am now getting the following message:
psql crmpicco
psql (9.6.16, server 10.11)
WARNING: psql major version 9.6, server major version 10.
Some psql features might not work.
Type "help" for help.
crmpicco=#
There's plenty of advice online for resolving this for Debian and Ubuntu, but nothing for MacOS/Homebrew.
How can I update psql locally to get rid of this message?
I suspect that you didn't run upgrade command for brew Postgres after upgrade to new version:
brew postgresql-upgrade-database
incase it didn't work, there is a gist online for home-brew Postgres upgrade, its for old version but still valid in how to upgrade in mac:
migrate_postgresql_database

How to fix pg_dump: aborting because of server version mismatch

My codebase and database is hosted on different servers with Ubuntu 12.04.
database => web1
codebase => web2
I am trying to take my database backup (web1) through the application(web2).
Now the problem is I have different versions of postgres installed on web1 and web2.
pg_dump: server version: 9.3.12 (web1)
pg_dump version: 9.1.23 (web2)
Is there any way I can resolve this issue without upgrading any package because there are multiple applications hosted and relying on these versions.
Thanks for helping!
pg_dump will refuse to connect to a server with a later version than itself for the good reason that it cannot guarantee that it will work.
Downgrading a database from 9.3 to 9.1 is definitely not supported, particularly since version 9.1 is out of support.
You'll have to use pg_dump from the 9.3 installation to dump the database, then you can try to load the result into the 9.1 database. Watch out for errors during restore and test well!
If you are using a SQL Client like Dbeaver and have more than one version of Postgres, remember to change the client version in the option. I was getting this error while using the Dbeaver's backup tool.

Install pgAdmin 3 without postgresql

I try to install pgAdmin3 for postgresql 9.4 but have an error:
Could not find your PostgreSQL installation. You might need to use the
--with-pgsql=DIR configure option.
I saw some questions in this resource, for example
Building pgadmin3-1.20.0 in CentOS 7 with PostgreSQL-9.4
But I've postgresql running in Docker and have not locally installation.
Any ideas how to compile pgAdmin without postgresql installation?

unable to locate postgresql in etc centos

I tried installing postgresql in my server which has centos
I followed this link
I am facing few complexity here.
I could not locate postgresql file in /etc directory.
psql (8.4.13, server 9.2.4) WARNING: psql version 8.4, server version 9.2. Some psql features might not work.
How can i solve these issues. can anyone suggest me.
I could not locate postgresql file in /etc directory.
The tutorial you linked to suggests the config files are in /var/lib/pgsql/9.2/data/...
psql (8.4.13, server 9.2.4) WARNING: psql version 8.4, server version 9.2. Some psql features might not work.
You've still got the 8.4 version of psql installed. Use your package tools (rpm/yum) to see what versions of the psql client packages are installed and where the binaries are.
It's common enough to run two different versions of PG on the same machine. Obviously each needs its own data directory and port number. Also, as you've seen psql will check the version number and warn if they are different. Basic queries still work, but obviously an 8.4 version won't know about extensions introduced in 9.1 and that sort of thing.

How to fix pg_dump version mismatch errors?

When trying to get local data to Heroku, I am encountering a version mismatch between two different versions of pg_dump.
Specifically, I am getting this message:
pg_dump: server version: 9.2.2; pg_dump version: 9.1.4
pg_dump: aborting because of server version mismatch
I have found others with this problem, but do not know enough to implement the proposed solutions. (I am new to Ruby on Rails, PostgreSQL, Heroku, and the Mac! Very much at the stage of playing around the picking things up as I go.)
I was thinking I might simplify my life if I uninstalled all PostgreSQL on my local machine and started again with a clean install of PostgreSQL 9.2.2 from http://postgresapp.com/, but I don't know how to go about doing the uninstall.
I'm running Mac OS X Mountain Lion 10.8.2.
OS X 10.8 comes with pg_dump version 9.1.4 in the /usr/bin directory, along with psql and other programs that are client-side PostgreSQL tools. It does not mean that PostgreSQL as a server is installed (unless you have OS X Server Edition).
So you don't have to uninstall PostgreSQL because it's not installed and it's better not to remove these postgres client tools in /usr/bin because they belong to the system as shipped by Apple. They just need to be side-stepped.
The package provided by postgres.app comprises both the PostgreSQL server and the client-side tools of the same version as this server. These tools get installed in /Applications/Postgres.app/Contents/MacOS/bin
To use these instead of the 9.1 ones from Apple when you work in a Terminal, postgres.app documentation says to do:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
and put it in your .profile file.
Once you have done that and you run pg_dump, you should no longer get the error that's it's the wrong version, because it would be the one that ships with postgres.app (currently 9.2.2).
I have this setup and it works OK for me.
If you only need to upgrade your pg_dump to the latest version and you have homebrew and mac, if the app has the latest version and your local pg doesn't:
brew upgrade postgresql
If you're using postgresapp 9.3.x, the path is different. The following worked for me (courtesy of http://sigmyers.com/blog/2013/3/12/postgres-pgdump-version-mismatch-error-postgresapp-postgresappcom)
export PG_BIN_PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin/"
PATH=$PG_BIN_PATH:$PATH
Check here for the latest path: http://postgresapp.com/documentation/cli-tools.html
I'm running Mountain Lion Server. My PostgeSQL server is at version 9.2.1 and the default tools are at 9.1.5.
I had to use:
PATH="/Applications/Server.app/Contents/ServerRoot/usr/bin:$PATH"
to make it work.
Yep, sometimes if you run Postgres.app this may happen after upgrade. Make sure you restart your Postgres.app - it will update your PATH.
In my case I have postgresql installed via homebrew and the executables are here: /usr/local/opt/postgresql#9.6/bin
Or you copy the dump and restore executions to the /Applications/Postgres.app/Contents/SharedSupport folder
or in PdAgmin you point the PG bin Path (in properties -> binary Path) to the path of the executables of your postgre