Thread: 7.3.9 Install Question - init.d/postgresql error?
Hi! I have just installed postgresql 7.3.9 into a RHEL3.0 environment. The install went fine. I went to start the postgresql server in the "service configuration" box, and that went well. The problem happened when I went to restart the server. I got the bad error: An old version of the database format was found.\nYou need to upgrade the data format before using PostgreSQL.\nSee (Your System's documentation directory)/postgresql-7.4/README.rpm-dist for more information. Note the incorrect postgresql-7.4 reference... I think I found the reason for it - I just do not know the proper solution. On the initial postgresql start, a database is created in /var/lib/pgsql/data, and a file called PG_VERSION is created - its contents are "7.3". This is proper. On restart, since the database now exists, the file /etc/rc.d/init.d/postgresql calls stop(), then start(). The start() routine verifies the existense of the PG_VERSION file and the data directory before it continues (is database there?). Since they are both there, the script then cats the contents of the PG_VERSION file and compares it to the script variable $PGVERSION, which is set to 7.4 in the very first line of the script. Note the catfile contents of 7.3 does not compare to the program value of 7.4 so it will ALWAYS error after the successful creation of a database when requested to restart. Q: Is it proper to simply change the 7.4 value in the script to 7.3? Other users have recently posted to this list with similar errors, and were told to scrub out old data directory. I suspect they will have same problem. Q: I bet this problem is only for 7.3/7.4 users? Thank you for any verification of fix procedure. DC __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Dianne Chen <diana_chen23@yahoo.com> writes: > I have just installed postgresql 7.3.9 into a RHEL3.0 > environment. .... > there, the script then cats the contents of the > PG_VERSION file and compares it to the script variable > $PGVERSION, which is set to 7.4 in the very first line > of the script. You have evidently got a 7.4 version of the initscript. I would suggest a very very careful recheck of what you did during the installation process, because this suggests you have got some unholy mixture of 7.3 and 7.4 installations, which is a recipe for disaster. Were you trying to install 7.3 over a pre-existing 7.4 installation by any chance? Your best bet may be to save aside the data directory (eg, rename /var/lib/pgsql out of the way), then completely deinstall every Postgres file you can find, then reinstall 7.3 from scratch, then put back the data directory. regards, tom lane
Hi Tom- Ok. I have checked. The /etc/rc.d/init.d directory was populated with the postgresql file after the postgresql-server-7.3.9-1PGDG.i686.rpm file was installed. Yes, I kept track of the differences as each rpm was installed. :) All rpm files were obtained from postgresql of course. Let's verify the contents of the rpm file: mkdir crap cp postgresql-server-7.3.9-1PGDG.i686.rpm crap cd crap cat postgresql-server-7.3.9-1PGDG.i686.rpm | rpm2cpio | cpio -iumd And now we have the file of concern right from the rpm file in a directory called crap/etc/rc.d/init.d The lines of interest in the postgresql file are still: ------------ contents of postgresql file ------ # Version 7.4 Lamar Owen. # Version 7.4.3 Tom Lane <tgl@sss.pgh.pa.us> # Support condstop for uninstall # Minor other changes suggested by Fernando Nasser. # Version 7.4.5 Tom Lane <tgl@sss.pgh.pa.us> # Rewrite to start postmaster directly, rather than via pg_ctl; this avoids # fooling the postmaster's stale-lockfile check by having too many # postgres-owned processes laying about. # PGVERSION is:PGVERSION=7.4 ----------------------------------------------- So my questions still remain: Q1: Is my fix to change PGVERSION to 7.3 from 7.4 correct in light of the fact that the db init that occurred from the first server start created a 7.3 database? Q2: Did someone mistakenly put a 7.4 file in the 7.3 rpm? Does it not matter? Outside of not being able to restart? I do not think this is a case of installation conflicts... right? The file has the problem right out of the rpm. Thanks as always for the help. DC
Dianne Chen <diana_chen23@yahoo.com> writes: > Let's verify the contents of the rpm file: > mkdir crap > cp postgresql-server-7.3.9-1PGDG.i686.rpm crap > cd crap > cat postgresql-server-7.3.9-1PGDG.i686.rpm | rpm2cpio | cpio -iumd > And now we have the file of concern right from the rpm file in a > directory called crap/etc/rc.d/init.d > The lines of interest in the postgresql file are still: > ------------ contents of postgresql file ------ > # Version 7.4 Lamar Owen. > # Version 7.4.3 Tom Lane <tgl@sss.pgh.pa.us> > # Support condstop for uninstall > # Minor other changes suggested by Fernando Nasser. > # Version 7.4.5 Tom Lane <tgl@sss.pgh.pa.us> > # Rewrite to start postmaster directly, rather than via pg_ctl; this > avoids > # fooling the postmaster's stale-lockfile check by having too many > # postgres-owned processes laying about. > # PGVERSION is:PGVERSION=7.4 > ----------------------------------------------- Hmm. Apparently Devrim stuck the 7.4 initscript into the 7.3.9 RPMs. Not good :-( > So my questions still remain: > Q1: Is my fix to change PGVERSION to 7.3 from 7.4 correct in light of > the fact that the db init that occurred from the first server start > created a 7.3 database? It will probably work, but I haven't compared the 7.3 and 7.4 initscripts in detail. regards, tom lane
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On Mon, 2 May 2005, Tom Lane wrote: >> # PGVERSION is:PGVERSION=7.4 >> ----------------------------------------------- > > Hmm. Apparently Devrim stuck the 7.4 initscript into the 7.3.9 RPMs. > Not good :-( :-( AFAIR, it was an old issue, found by Simon. I remember to have fixed it :( Anyway, I think it will be better to fix it compeletely in 7.3.10. Apologies everyone :( >> So my questions still remain: > >> Q1: Is my fix to change PGVERSION to 7.3 from 7.4 correct in light of >> the fact that the db init that occurred from the first server start >> created a 7.3 database? > > It will probably work, but I haven't compared the 7.3 and 7.4 > initscripts in detail. It will work... Regards, - -- Devrim GUNDUZ devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.tdmsoft.com.tr http://www.gunduz.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCdqE7tl86P3SPfQ4RAkfcAKCU3iRlTq6Zd2GwTYDMfCqUhZ6vHQCfXH4X 9rVDbvtQv4/scEI46Q5OS/s= =IEy2 -----END PGP SIGNATURE-----
All, Thank you for the confirmation and reply. DC -------------- --- Devrim GUNDUZ <devrim@gunduz.org> wrote: > > Anyway, I think it will be better to fix it > compeletely in 7.3.10. > > Apologies everyone :( > > > > > It will probably work, but I haven't compared the > 7.3 and 7.4 > > initscripts in detail. > > It will work... > > Regards, > - -- > Devrim GUNDUZ > devrim~gunduz.org, devrim~PostgreSQL.org, > devrim.gunduz~linux.org.tr > http://www.tdmsoft.com.tr > http://www.gunduz.org __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com