Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pg_dump problem

Status
Not open for further replies.

totti24

Programmer
Aug 2, 2002
32
0
0
MY
I've installed Red Hat 8.0 with the SQL package. Later i found out that the version for postgresql in the sql package is 7.2.2. Then I installed version 7.3.1. now the problem i'm facing is, i can't use the pg_dump command coz it's giving me this error

"pg_dump: server version: SAGES/pg_dump.mo; pg_dump version 7.2.2"
"pg_dump: aborting because of version mismatch"

Before this, i've key in the command

"$pg_dump -f admin.bak admin"

can i know what can i do to solve this problem. I've already check the version of my pg_dump command under the data directory. it's version 7.2.2. I think it's taking the version from RH and not the version i've installed. Please advice.
 
Hi totti24,

When you build postgres on RH 8.0, did you pass the RH 8.0 default paths to the ./configure script. For example, I configured the source tree like:

./configure --prefix=/var/lib/pgsql --exec-prefix=/var/lib/pgsql --with-perl

Then I compile postgres like:

gmake

Then I installed the build like:

gmake install

This placed all the postgres programs like pg_dump, psql, postmaster, pg_ctl, etc in the /var/lib/pgsql/bin directory. By default, all of these postgres file are in the /usr/bin directory. Therefore, to make sure that the new version of postgres is used, I copied all the files in the /var/lib/pgsql/bin directory to /usr/bin directory like:

cp /var/lib/pgsql/bin/* /usr/bin

I Also edited the /etc/rc.d/init.d/postgresql script to change the version number in it from 7.2 to 7.3. After this change I was able to start postgres 7.3 during booting as well as using the following commands:

/etc/rc.d/init.d/postgresql restart

or

service postgresql restart

LelandJ
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
This placed all the postgres programs like pg_dump, psql, postmaster, pg_ctl, etc in the /var/lib/pgsql/bin directory. By default, all of these postgres file are in the /usr/bin directory. Therefore, to make sure that the new version of postgres is used, I copied all the files in the /var/lib/pgsql/bin directory to /usr/bin directory like:
You can put all the binaries in /usr/bin if you add this option to the configure line:
Code:
--bindir=/usr/bin
//Daniel
 
Hi danielhozac,

After making postgresql 7.3 on my RH 8 system, I had all the files placed in the /var/lib/pgsql/bin directory. This worked out well for me, because I accidentially installed postgres 7.2.2 via RH auto update agent. The RH auto update agent over-wrote all my 7.3 postgres files in the /usr/bin directory. It also over-wrote my /etc/rc.d/init.d/postgresql file.

I was able to straighten everything back out by re-coping my /var/lib/pgsql/bin/* version 7.3 back to the /usr/bin directory. I also had to re-edit the /etc/rc.d/init.d/postgresql script to change the version number from 7.2 to 7.3. After these changes, everything worked normally again, so for me having a backup of everything in /var/lib/pgsql/bin directory worked out great.

LelandJ
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top