I recently did a clean install of Lion Server on my Mac Mini Server then immediately upgraded to Mountain Lion without copying any of my data from my backup files. Then I reinstalled my Rails applications and deployed them to production (same machine). I also took my PgAdmin backup file that I created under Lion Server and rebuilt my database using it after upgrading to Mountain Lion.
When I go into the PostgreSQL terminal I get the following message. The basic commands I am using this for work without any problems.
psql (9.1.4, server 9.2.1)
WARNING: psql version 9.1, server version 9.2.
Some psql features might not work.
Type "help" for help.
I also had problems with implementing the queue_classic gem in my Rails application because it said that the server version of psql is 9.2.1 but pg_dump is version 9.1.4.
psql --version produces psql (PostgreSQL) 9.1.4
pg_dump --version produces pg_dump (PostgreSQL) 9.1.4
I was using gem pg 0.12.2 in my Rails application. Now I am using version 0.14.1. The problem began after I upgraded to Mountain Lion while still using version 0.12.2. When I rebuilt my Rails app the databases were createdby hand in PgAdmin. I did rake db:migrate to rebuild the table structures and indices. I then used my PgAdmin tar backup file to rebuild the data.
I attempted to install the latest stable version of phpPgAdmin. I had a problem because there was a missing column in PostgreSQL. The documentation from PostgreSQL stated that the column was removed in version 9.2. At this point I determined that the database was 9.2.1. I also assumed at the time that was the version that Mountain Lion had installed. I was wrong in that assumption.
I then reinstalled PgAdmin for database maintenance in order to restore my databases using my backup. When I check the properties on the database used in my Rails app it says it is a PostgreSQL 9.2.1 database.
These are the only software packages that I have installed relating to PostgreSQL at all. I have not installed another version of PostgreSQL on my machine unless somehow one of these packages did something that I was not aware of.
I do not use Homebrew, MacPorts or any similar tools. I may at some point.
When I do a Finder search for psql in /usr I only find one file in /usr/bin. My guess that is the one that is version 9.1.4.
All the research that I have read about this is regarding people that have installed another version of PostgreSQL themselves. This may sound really dumb but how on earth can I create a database with a higher version of PostgreSQL than is currently installed? This is apparently what happened when I rebuilt my database from my backups even though I did not specify a version. How can I fix this problem? I would like to use version 9.2.1 since I believe that is the latest stable version of PostgreSQL. I am very open to suggestions. I just need my database to somehow match the version of PostgreSQL I am using so I will not be impeded in using gems or other PostgreSQL processes that check the version of psql and pg_dump. I guess I have two options, either install PostgreSQL 9.2.1 somehow or recreate my database under 9.1.4. I just wonder about having two versions of PostgreSQL installed.
Any help would be appreciated.