Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-27-2003, 11:27 PM
|
#1
|
Member
Registered: May 2003
Location: Ontario, Canada
Distribution: Mandrake 9.0, RedHat 7.3, Mandrake 9.2
Posts: 178
Rep:
|
upgrading postgresql
I'm trying to upgrade postgresql.
I have mandrake 9.0 which came with pgsql7.2.2
I've downloaded, unzipped, compiled and installed postgresql 7.3.3
I can run it from /usr/local/pgsql/bin
I even compiled PHP to use it.
My only problem is that the old version 7.2.2 runs on boot.
I followed the instructions on installing at postgresql.org but I found nothing to help me switch which version runs at boot.
my postgres user's home directory is still /var/lib/pgsql
Where have I gone wrong and what can I do to fix this?
|
|
|
06-29-2003, 07:11 PM
|
#2
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
I think my problem is similar. Under RH 8, I upgraded PGSQL 7.2.2 to 7.3.2. It has been more difficult to get into it ever since. Sometimes it appears that it may have started under Server|Services. How can I reset that to refer to the proper partition?
Since a disorderly shutdown last night (caused by something else entirely) I can't get into PGSQL at all, and when I try, all command line functions slow down. Sometimes I have to leave the computer for several minutes even to log out.
From upgrade until last night, I have been getting in by using pg_ctl -D /var/lib/pgsql/data start.
|
|
|
07-04-2003, 02:59 PM
|
#3
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
PostgreSQL after update
I finally copied all my data to another directory, not having succeeded at that time in using pg_dump/pg_dumpall, and reinstalled. It works, but I have no access to existing data (in ../data/base). I had backed everything up to text files using COPY so still have the data but have to go through rebuilding all the tables before I can use anything. Is there a better solution, besides using pg_dump next time (which I subsequently found out how to do)?
|
|
|
07-04-2003, 03:02 PM
|
#4
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
Responding directly to one of Pete's questions, since I got a version conflict when trying to use pg_dump, I did a find on pg_dump and compared dates. Then I copied the newer version of all pg_* files over the older ones.
|
|
|
08-14-2003, 09:48 AM
|
#5
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
I had the exact same problem because my RH 8 came with 7.2 and I went to 7.3 so I could use PGADMINIII on my winXP box.
I found the problem for me was that RedHat uses the old style installation directories for Postgres and when you download the new version of Postgres from the postgres website, it installs in a different directory set. The solution for me was to manually erase the old postgres setup. This was not as hard as I thought it would be because the directory structure for the old postgres is well-documented.
Basically I did something like this (warning**going from memory here):
The new style use /usr/local/pgsql/data as the data directory
The old style used /var/lib/pgsql/data
So I erased the /var/lib/pgsql/data folder along with /var/lib/pgsql folder.
RedHat will still execute the old binaries though because the default location for a RedHat postgres install is
/usr/bin
while the "website download" version of postgres installs its binaries in
/usr/local/pgsql/bin
To fix this, I
ls -l /usr/local/pgsql/bin
to get a complete list of the binaries that comes with postgres. Then I went to the /usr/bin directory and erased each program(VERY CAREFULLY) that matched up.
In other words, because RH installs those binaries in one folder and the "downloaded" postgres in another, you literally have two copies of everything. So why does the old version run? Probably because /usr/bin is in your search path and /usr/local/pgsql/bin is not. So if you just type in pg_ctl its going to hit the old one in /usr/bin.
Once this is done, I set up the variables in my /etc/profile to ensure the correct version of postgres was being used. For me these were:
PGDATA = /var/local/pgsql/data
PGLOG = /var/log/pgsql
PGPORT = 5432
PGHOST = "localhost"
and added the new postgres binaries to my search path by
pathmunge /usr/local/pgsql/bin
in the same file.
|
|
|
08-14-2003, 09:51 AM
|
#6
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
By the way, before you destroy the old data directory
/var/lib/pgsql/data
make sure you backup all your database files.
pg_dumpall > outputfile
Also, do not assume my directory paths are correct. I posted that answer from memory.
|
|
|
08-14-2003, 02:07 PM
|
#7
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
I deleted all the old stuff and reloaded 7.3.3 (tried 7.3.4 first but had a lib problem). Now it starts automatically and runs but when I try pg_dump or pg_dumpall from
/usr/local/pgsql/bin/pg_dump
I get
error while loading shared libraries: libpq.so.3:
cannot open shared object file: No such file or directory
Searching for libpq.so.3 (the same one that kept me from installing 7.3.4):
/usr/bin/libpq.so.3
/usr/local/bin/libpq.so.3
/usr/local/pgsql/bin/libpq.so.3
/usr/local/pgsql/lib/libpq.so.3
I can now only back up by using COPY to a text file, which leads to problems when reinstalling, if that becomes necessary (no schema, for one thing).
|
|
|
08-14-2003, 02:25 PM
|
#8
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
jdtiede - you might try this:
in the file:
/etc/ld.so.conf
you may need to add:
/usr/local/pgsql/lib/libpq.so.3
then run /sbin/ldconfig
|
|
|
08-14-2003, 04:48 PM
|
#9
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
Thanks. I did try adding to /35c/ld.so.conf and running /sbin/lcdonfig. But before I did that I rebooted because I could no longer log on as my self; only as postgres and root. I added a new user and deleted myself (keeping my /home dir for the new user) and had the same problem. Pgsql didn't come back up automatically, but I ran postgres -D /usr/local/pgsql/date start and that did it. But if I log on as postgres and try su, it seems to hang up on password, yet if I deliberately enter a wrong password it comes back in a reasonable time (2 sec., maybe) with "incorrect password."
|
|
|
08-15-2003, 07:59 AM
|
#10
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
Is it possible a non-postgres binary got erased?
Were you having these problems before attepting to remove old postgres and install new postgres?
Is the /etc/passwd file in good shape and proper format?
I am not sure what the process RH goes through when trying to validate root or another user. Is there someone else in the forum that can help with this?
I do not think this last part is a postgres problem, but I am defnitely not good at diagnosis "non-postgres" problems.
|
|
|
08-17-2003, 03:17 PM
|
#11
|
Member
Registered: Apr 2003
Location: Baton Rouge, LA
Distribution: Kubuntu 12.04, 12.10, 13.04a
Posts: 244
Rep:
|
I was locked out of my home directory for a while, which I think was result of trying to make changes to postgres, but I ran chmod 777 /home and that fixed it.
The real question now is where does postgres expect libpq.so.3 to be? If I knew that, wouldn't I be able to back up properly?
|
|
|
08-18-2003, 07:41 AM
|
#12
|
Member
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313
Rep:
|
On my system, it is in:
/usr/lib/libpq.so.3
Here is a link to download the postgresql client shared libraries. At the bottom of the list, you will also notice they have documented where the libraires are stored by default. There is also some documentation on why you need the library in the first place.
http://ajax.ifsic.univ-rennes1.fr/./...3-12.i386.html
|
|
|
All times are GMT -5. The time now is 08:04 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|