Sunday, April 20. 2008An Almost Idiot's Guide to PostgreSQL YUMPrinter FriendlyRecommended Books: The Definitive Guide to CentOS
1000+ Commands for Fedora, CentOS and Red Hat
Foundations of CentOS Linux: Enterprise Linux On the Cheap
Comments
Display comments as
(Linear | Threaded)
I followed the instructions and installed postgresql 8.3 and postgis on fedora 8. After running initdb and psql i always get "psql: undefined symbol: pg_valid_server_encoding_id" for any command. The OS already had pre-installed postgresql 8.25. so, I guess there is a library lookup problem. Any suggestions?
Are you calling the psql just
psql or giving the full path to psql. I suspect you probably have multiple psqls on your machine and call it directly and as you said library lookup mismatch. If you are just doing psql Try doing - the below to get the full path of the psql you are using which psql Try doing cd / find -name "*psql" -print To pull up the different locations where you have psql is and try each one. You may also want to try ldd -d /path/to/psql to see what libraries it is binding to. It might be binding to the older ones.
I get after errors "after running" psql .i.e. if I give a select statement or something. Anyway, there is only one psql (/usr/bin/psql) and following is the output of ldd and I am not sure which is the old or the new library -
linux-gate.so.1 => (0x00110000) libpq.so.5 => /usr/lib/libpq.so.5 (0x00376000) libxslt.so.1 => /usr/lib/libxslt.so.1 (0x02d6d000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00a30000) libpam.so.0 => /lib/libpam.so.0 (0x00daa000) libssl.so.6 => /lib/libssl.so.6 (0x00998000) libcrypto.so.6 => /lib/libcrypto.so.6 (0x00725000) libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00882000) libz.so.1 => /lib/libz.so.1 (0x0032a000) libreadline.so.5 => /usr/lib/libreadline.so.5 (0x0033f000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x02ab3000) libdl.so.2 => /lib/libdl.so.2 (0x00308000) libm.so.6 => /lib/libm.so.6 (0x002dd000) libc.so.6 => /lib/libc.so.6 (0x00182000) libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x008e3000) libpthread.so.0 => /lib/libpthread.so.0 (0x0030f000) libaudit.so.0 => /lib/libaudit.so.0 (0x00dca000) libcom_err.so.2 => /lib/libcom_err.so.2 (0x006e1000) libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x006e6000) libresolv.so.2 => /lib/libresolv.so.2 (0x005d9000) libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x0070e000) libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00719000) libtinfo.so.5 => /lib/libtinfo.so.5 (0x02d0a000) /lib/ld-linux.so.2 (0x00163000) libselinux.so.1 => /lib/libselinux.so.1 (0x0040a000)
Thanks for the comment, Leo. I just had a problem with new psql binding to the older libpq.so.5 that was in the linker's path.
I think you saved me quite a bit of time wasting. Cheers, Joshua
I recommend to add few more comments. -If you have Fedora that comes with pre-installed postgresql (i had postgresql 8.25) then first uninstall the default installation and then follow the instructions above to install 8.3 version. To uninstall existing installation first run rpm -qa | grep postgres. this will give list of postgresql packages installed. remove them by using rm -e . You can ignore dependencies by using --nodep option. Alternately, if you have data on pre-installed version then follow the upgrade procedure mentioned postgresql site.
The mistake I did was that I did a fresh install of 8.3 on top of pre-installed 8.25 which confused the client to read from the wrong library. I uninstalled existing postgres and installed using instrauctions mentioned here and now i got it correct. Regards, Pranjal
Pranjal,
Thanks for the update. We'll try to incorporate into the article.
Many thanks!
CentOS 5 on Amazon AWS gives a bad version number; hand-editing the pgdg yum file fixes that.
When using CentOS 5 it seems impossible to install postgresql 8.3 when one also needs httpd. This is because httpd links against libpq.so.4 by way of libaprutil-1.so.0, so one cannot upgrade postgresql-libs-8.1.9 of which the apr-util dependency is part. Any ideas how to fix (besides not using RPMs)?
Found a solution. http://www.westnet.com/~gsmith/content/postgresql/pgrpm.htm describes how to upgrade PosgreSQL on CentOS 5. Works like a charm!
Note, I initially had trouble importing the backup. I had put my pg_hba.conf file back in place first but it barfed on roles and accounts. The dump_all contains the matching authentication parameters. So before putting the old conf back:
/etc/init.d/postgresql start su postgres psql -e -d template1 -f /tmp/postgresqlserverdbs.sql exit # Muck with the pg_hba.conf, i.e. # cp ../../pgsqlold/data/pg_hba.conf . /etc/init.d/postgresql restart
I tried your process and am stuck at yum giving the following error:
Error: Cannot access repository dir //var/cache/yum/pgdg83 after installing the above RPM. Any suggestions?
Raj,
That is strange. I presume you get this after you install the rpm config and before you do a yum install. Only thing that looks fishy is that extra / I would think it would be /var instead of //var. Which Linux distro are you running. My only thought is that maybe you picked the wrong yum repo for your Linux. The one I had listed in the example above is for RedHat EL (CentOS and Fedora require a different one which is listed in the help link we provided)
Hi,
I followed the directions, the package installed fine, but if i run yum list |grep -i postgres nothing shows up, almost as if it's ignoreing the pgdg package... Any idea's?
That is strange. Just verified it works on our yum installs. Which postgresql do you have installed?
What do you get if you do yum list |grep -i pgdg for us that lists all the packages coming from pgdg83. Perhaps its something wrong with your Yum repos config file. Our /etc/yum/pluginconf.g/rhnplugin.conf looks like this (this is on RHEL4) [main] enabled = 1 gpgcheck = 1 exclude=postgresql*
I had similar trouble when using the pgdg-8.4 repos on CentOS 4.2. Using pgdg-8.3 repos worked fine though.
Hrishi,
Did you resolve your issue. I recall Devrim saying that for 8.4 he won't be supporting CentOS 4 or EL 4. I'm wondering if that is the problem you are running into.
Hi,
I think you might write in this how to that the package postgresql-server must be installed to performe the initdb -D /usr/local/pgsql/data command : yum install postgresql-server Regards
Originally it wasn't this way. I think it was changed in later versions. If you look at our addendum -- you'll see what I mean. Anyrate you are right we should have update this article to minimize on confusion.
Great article it really helped me out. I have one question. Can the geos dependency be changes on the postgis install?
============================================================================= Package Arch Version Repository Size ============================================================================= Installing: postgis x86_64 1.3.6-1.rhel5 pgdg83 1.0 M Installing for dependencies: antlr x86_64 2.7.6-4jpp.2 base 1.1 M geos x86_64 2.2.3-3.el5 epel 398 k gjdoc x86_64 0.7.7-12.el5 base 886 k java-1.4.2-gcj-compat x86_64 1.4.2.0-40jpp.115 base 29 k jpackage-utils noarch 5.0.0-1.jpp5 rightscale-epel 61 k jpackage-utils-compat-el5 noarch 0.0.1-1 rightscale-epel 2.7 k proj x86_64 4.6.0-1.rhel5 pgdg83 169 k Transaction Summary ============================================================================= Install 8 Package(s) Update 0 Package(s) Remove 0 Package(s) Geos 2.2.3-3.el5 is really old and I need at least 3.1 since it has functions that I need. Any ideas?
Brandon,
Yap noticed that. I usually compile my own. I'll try to get Devrim to up the geos package. It really is quite annoying that he still has geos 2.2.3 in there. I'll write up another article on that. Sadly it requires you compile PostGIS on your own since PostGIS checks which version of geos and only enables the advanced GEOS functions at compile time if its bound to the newer GEOS.
Brandon,
Actually the process of installing is documented in PostGIS docs. There are some gotchas about when GEOS links don't bind that I have to write up. http://postgis.refractions.net/documentation/manual-1.3/ch02.html#PGInstall You might actually want to wait a week or so. GEOS 3.1.1 is about to come out and has some important bug fixes for ST_Buffer
Thank you!
Installed like a dream on my Fedora7 release. Several years after beginning this journey into developing, this is the absolute first instruction set I have used that has worked as described. At only one point was anything left to look up. Being new to pgsql, I did not know the 'quit' command after step 8 (ctrl-D). Thanks to Regina for the info on the GEOS dependency!
Aren't you trying to install 8.3? Because 8.4 and 8.5 doesn't work.
Rodrigo,
No. This is an older article. Read our newer one on installing 8.4. http://www.postgresonline.com/journal/index.php?/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html We haven'tt tried the 8.5 beta yet but presume it would be the same steps except different rpm.
I can't set up the yum repository in CentOS 3.5.
# rpm -ivh pgdg-centos-8.5-1.noarch.rpm error: Failed dependencies: rpmlib(FileDigests)
I believe on CentOS 4 and 5 are supported by the PostgreSQL yum repository
On RHEL5 for x86_64, you will need to add a section to rhnplugin.conf to get this working:
[rhel-x86_64-server-5] enabled = 1 exclude=postgresql* postgis* Note that the rhnplugin.conf file is not a full-fledged conf file. exclude directives appear to not work in the [main] section, and only work in the sections for individual repositories. This is true, AFAIK, as of yum-rhn-plugin-0.5.4-13.el5.noarch.
Hello,
I have Fedora Core 9 x64 and PostgreSQL 8.3.7 and want to upgrade it to latest 8.3 branch. My question is what RPM archive I need because I can't find de RPM for the 8.3.10 version at http://yum.pgsqlrpms.org/reporpms/8.3/. Can I use the RPM for another version of Fedora, or can I add the yum repository for a newer version of Fedora, F 11, and upgrade from here? Thank you very much.
Alberto,
I think the repo moved now that Devrim moved. -- looks like the one you are looking for is here: I know the url looks almost the same but slightly shorter http://yum.pgrpms.org/8.3/fedora/fedora-9-x86_64/repoview/
I'm trying to install PostgreSQL 8.3.10 on Centos 5 via these instructions. When I get down to setting up PG to run as a service, I get an error.
service postgresql start => could not create lock file "postmaster.pid": permission denied However, sh /etc/rc.d/init.d/postgresql start => OK What's the difference?
Could be your postgres account doesn't own the data cluster
You might want to do a chown -R postgres yourpostresdatafolder to make sure the postgres account owns it.
Nope, verified that postgres owns the cluster. Note that postgresql DOES run, just not through "service postgresql start" so it is probably something in the startup script that I'm not seeing.
Hmm strange then. Never seen that error before. The only other thing I can think of is that its already running. the postmaster.pid can't be overwritten while its running, though it gives a different error (something to the effect its already running).
Sometiems postmaster.pids get left over from incomplete shutdowns and can't be overwritten. So I guess I would try deleting the postmaster.pid file in your postgres data cluster if it exists. That file should only exist when postgres is running.
[root@zu ~]# service postgresql start
Starting postgresql service [FAILED] [root@zu ~]# tail /usr/local/pgsql/data/pgstartup.log 2010-03-23 17:03:30 GMT FATAL: Could not create lock file "postmaster.pid": Permission denied [root@zu ~]# sh /etc/rc.d/init.d/postgresql start Starting postgresql service [ OK ] Verified no leftover postmaster.pids, no postmaster running, and as you see, *immediately* after trying and failing with service I can start by manually running the same script that service should be trying to run. There has got to be something weird about the environment or permissions that service is using.
I see the same thing, postgres fails at start-up but manual start is fine, did you ever figure out what could be wrong?
Thanks
I disabled SElinux and after that everything is fine!
I only see F11 and F12 in the repo listing. What happened to all the other packages? I want to update some of my F7 and F9 systems but I can't find the packages now.
Which location are you looking?
Devrim has setup a new distro that I believe does have F7-F9 I will update this article to reflect it. http://yum.pgrpms.org/8.4/fedora/
hi i try install pgadmin3 in 64 bit system centOS 6
do command : yum install pgadmin3.x86_64 get error : Loaded plugins: fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * base: mirror.nus.edu.sg * extras: mirror.nus.edu.sg * updates: mirror.nus.edu.sg Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package pgadmin3.x86_64 0:1.12.3-1.rhel6 set to be updated --> Processing Dependency: libwx_gtk2u_ogl-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu-2.8.so.0(WXU_2.8.5)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_xrc-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu_xml-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: wxGTK for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_aui-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_stc-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_html-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu_net-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_adv-2.8.so.0(WXU_2.8)(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_qa-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_xrc-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_ogl-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu_net-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_richtext-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_adv-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_html-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_stc-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu_xml-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_core-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_baseu-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Processing Dependency: libwx_gtk2u_aui-2.8.so.0()(64bit) for package: pgadmin3-1.12.3-1.rhel6.x86_64 --> Finished Dependency Resolution Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_stc-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_aui-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_core-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_adv-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: wxGTK Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_stc-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_ogl-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_html-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_html-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_aui-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_ogl-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu_xml-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu_net-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_xrc-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_qa-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_xrc-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu_net-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_richtext-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu_xml-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu-2.8.so.0()(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_gtk2u_adv-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu-2.8.so.0(WXU_2.8)(64bit) Error: Package: pgadmin3-1.12.3-1.rhel6.x86_64 (pgdg84) Requires: libwx_baseu-2.8.so.0(WXU_2.8.5)(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest what wrong ???
Quote:
vi /etc/redhat-release also gives details of the version you are running more /etc/redhat-release would be better, particularly if it's a newbie who might get stuck in the editor (not knowing to press ":" and type "q!" to quit) Great article by the way. |
Entry's LinksQuicksearchCalendar
Categories
Blog Administration |
In our April Issue An Almost Idiot's Guide to PostgreSQL YUM we covered using the new PostgreSQL Yum repository to install the PostgreSQL 8.3.1 release on Fedora, RedHat Enterprise, and CentOS. We also received numerous useful feedback from others on i
Tracked: Jul 06, 06:34
We had the pleasure of doing a fresh install of PostgreSQL 8.3.5 on RedHat EL4 box and when using the Yum repository, we noticed a couple of changes from last time we did this. This could have been an oversight in our documentation before. Changes to
Tracked: Nov 26, 21:09
Tracked: Dec 20, 12:29
Tracked: Jan 06, 03:44
Tracked: Jul 15, 04:36
Tracked: Jul 15, 04:36
Tracked: Dec 12, 18:20
Tracked: Jun 21, 21:06