Saturday, November 28. 2009An almost idiot's guide to Install and Upgrade to PostgreSQL 8.4 with YumPrinter FriendlyRecommended Books: PostgreSQL 8.4 Server Administration Official Guide PostgreSQL 8.4 Server Programming
1000+ Commands for Fedora, CentOS and Red Hat
Comments
Display comments as
(Linear | Threaded)
I think you forgot to advise users to use pg_dumpall for dumping global objects; users, tablespaces, etc.
Step (6) in your procedure is better replaced with this:
service postgresql initdb That does the same thing, but it's less typing and you can be sure the directories created will have the right permissions. Step (7) is really not a good idea. If you want to relocate PGDATA, you want to edit /etc/sysconfig/postgresql/postgresql and set it there. Look at the init script and you can see how it includes that file after setting a default value for it in the script. Editing the init script will put you into a position where you can't accept updates to the init script itself from future versions without doing a manual merge. If you just set it in the sysconfig file instead, this problem goes away. As for the integer datetime switch, the only good way to handle this if you want to keep your 8.3 database is to download the source RPMs from the yum repo, tweak them to use the old format, and then build your own RPMs. It's possible to automate that into a script, so while not quite as easy as yum it's at least possible to manage in a way that includes upgrades without too much overhead. For people with a database small enough that they can dump and reload, you're right that they should just suck it up and covert now rather than go through that.
Thanks for the tips -- we'll update to reflect.
To Gurjeet I think we did include pg_dumpall note in step 2 but perhaps we should put that in bold.
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* Otherwise, yum will pull from the rhel repo rather than the pgdg84 repo. 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.
Thanks very much for the setup instructions. As a data point (CentOS 5.4), this did not work for me:
service postgresql initdb it gave me a 'FAILED' message every time, complaining about permissions to my custom PGDATA directory. However, it worked fine if I initialized manually instead (as postgres): initdb -D /path/to/my/data It might be worth mentioning that in addition to overriding PGDATA in /etc/sysconfig/pgsql/postgresql, you can also override PGLOG to tell it where to output its daemon log (not transaction logs).
I also faced similar issue, Did you figured out a way to make "service postgresql start/initdb" work. I am afraid without it, DB won't start on system startup..of course a script can be written..but it will be great to do it standard way.
Thanks :-)
I'm on clearOS, which is centOS 5.4, and am getting a missing dependency error during yum install.
yum install postgresql-devel.i386 ... ---> Package postgresql-libs.i386 0:8.4.3-1PGDG.el5 set to be updated --> Processing Dependency: libldap_r-2.3.so.0 for package: postgresql-libs ---> Package compat-postgresql-libs.i686 0:4-1PGDG.rhel5 set to be updated --> Finished Dependency Resolution Error: Missing Dependency: libldap_r-2.3.so.0 is needed by package postgresql-libs Any help for me here?
Hmm we've never gotten that error before. I forget off-hand which CentOS version we used. Perhaps it had it already. It was of the 5 variant.
Have you tried doing a yum install ldap
I have tried this from fresh installs of Oracle Enterprise Linux 5.4 and Redhat 5.5.
Postgresql installs fine. yum install pgadmin3 fail with the same error in both systems. Error states that wxGTK is missing. Is there a simple work around to resolve this?
Most of my Linux OS except for OpenSUSE are windowless so never tried installing pgAdmin on them since it doesn't make sense to. I take it you have some sort of desktop installed on yours like GNOME or KDE?
I would try a yum install wxGTK if you haven't already -- not sure what wxGTK is listed under though. you could do a yum list wx* I suppose and it should list it.
Upgrading PostgreSQL 8.1 to 8.4 on CentOS 5.5
http://blog.lystor.org.ua/2010/05/upgrading-postgresql-81-to-84-centos-55.html
"On Fedora, edit fedora.repo and fedora-updates.repo, [fedora] sections"
I think you need to add [updates] to the sections. fedora.repo has [fedora] and fedora-updates.repo has [updates] Dave
This will fail, if You do not remove
the libs yum remove postgresql-libs on CentOS4.8 Regards Martin
It might be time to modernize this for 9.0.0. Briefly, here is the recipe for CentOS 5.5:
# edit /etc/yum.repos.d/CentOS-Base.repo using same instructions wget http://www.pgrpms.org/9.0/redhat/rhel-5-i386/pgdg-centos-9.0-2.noarch.rpm rpm -ivh pgdg-centos-9.0-2.noarch.rpm yum install postgresql90-server A few important things to note: new URL and new naming scheme: postgresql90-*
Where is the pg_restore command?
I've dumped my complete 8.4 install and reinstalled it from the cent-os 9.0.2 rpm, but now my pg_restore command is gone. Can anyone explain what has gone wrong?
I think in version 9.0 the pgrms rpms were changes so you can have two versions of PostgreSQL running. So the pg_restore is no long in the /usr/bin.
Unfortunately don't have a Linux box handy at moment to check, but from Devrim's note, I would say you should be able to find it in /usr/pgsql-9.0/bin folder Read the below: http://people.planetpostgresql.org/devrim/index.php?/archives/50-Upgrading-from-8.4-to-9.0-on-Fedora-Red-Hat-CentOS-using-RPMs.html
Just to help some newbie like me :)
If you want to upgrade from 8.3 to 9.0. Just use a pipe because of a tablespace now way to dump the whole database so : /pg_dump -p old_db_port -d old_db -t table | ../../9.0/bin/psql -p new_db_port -d new_db >> /dev/null |
Entry's LinksQuicksearchCalendar
Categories
Blog Administration |
Tracked: Dec 04, 13:05
Hello, and welcome to the 171st edition of Log Buffer, the weekly review of database blogs. Let’s get it going this week with . . . Oracle Uwe Hesse, the Oracle Instructor look at result cache, another brilliant 11g new feat...
Tracked: Dec 04, 15:29
Tracked: Mar 23, 02:49
Tracked: Jul 15, 04:34
Tracked: Sep 30, 03:24
Tracked: May 05, 06:39
Tracked: May 05, 09:40
Tracked: May 27, 08:41
Tracked: May 27, 08:41
Tracked: Jun 21, 04:16
Tracked: Sep 13, 04:49