Grzegorz Rozniecki's picture


I'd like to upgrade PostgreSQL to version 9.0 on TKL PostgreSQL Appliance and make TKLPatch. I've searched for the best way to do this with least effort and stuck with three options (from most time-consuming to less).

  1. Build PolstgreSQL 9.0 appliance from scratch on top of TKL Core. Sounds like reinventing the wheel beacuse there is already appliance with Postgres 8.4 installed.
  2. Patch existing Postgres 8.4 apliance with TKL Patch: install 9.0 version, find all places in all config files (pgadmin, webmin, more?) that should be changed for version 9.0, remove old 8.4 - of course it's problematic, because there is probably more places I don't know about that should be changed. 
  3. Edit tklpatch that was used to build original TKL PostgreSQL Appliance so it contains Postgres 9.0 instead of an old one.

I'd choose option 3 if I could, but I can't find original tklpatch-postgres.tar.gz file... If I had such tklpatch, I'd look at it's source and edit it. 

So my real question is: Are official appliances made via tklpatch? If yes, can I find their tklpatches anywhere? If no, I'll give option 2 a try ;)

Jeremy Davis's picture

So there is no PostgreSQL patch. So that rules out option 3.

In some respects option 1 could potentially be the cleanest way to go for the reasons you suggest (in option 2), although as you also say in option 1, it is somewhat reinventing the wheel.

So personally I would favour option 2 initially, with option 1 as the fallback plan if you hit too many road blocks with 2.

As for the details, you will find that Martin Pitt maintains a PostgreSQL v9.0 backport PPA for Lucid/10.04 (the basis of TKL v11.x). While PPAs can be a potential security risk, I would be inclined to trust this one as he is also (AFAIK) the official maintainer of the Debian and Ubuntu packages. I have read that once an official v9 package is included in Ubuntu (Natty?) this will also enter the official Ubuntu Lucid backports repo. But until then, have a try with this PPA.

Here's what I would try first:

  • Start with clean TKL PostgreSQL v11.x appliance install.
  • Add PPA to sources (see above link).
  • Upgrade all packages (which will hopefully automagically upgrade PostgreSQL to the latest version available from the PPA). Try using the following code (please note you may hit the udev bug when running apt-get upgrade):
apt-get update
apt-get upgrade
apt-get dist-upgrade

If that doesn't work I'd try this:

  • Start with clean TKL PostgreSQL v11.x appliance install.
  • Add PPA to sources (see above link).
  • Uninstall current PostgreSQL [apt-get remove --purge postgresql]. Although prior to that I would probably get a copy [cp] of the current config (--purge will delete it). I'm not sure but I'd guess that you'll find a postgresql.conf file (or similar) in /etc/postgresql...?
  • Install PostgreSQL v9 [apt-get update && apt-get install postgresql-9.0]

Once you have tested and documented the process you will just need to create a TKLPatch. If you can get it working with either of these above methods it should be a very simple patch to make.

Good luck and let us know how you go :)

Grzegorz Rozniecki's picture

I've already given option 2 a try using Martin Pitt's PPA repo, but I hit udev bug you described - thanks for tip, I put udev on hold ;)

It turned out that apt-get upgrade doesn't upgrade Postgres 8.4 to 9.0 but makes separate directory 9.0 besides 8.4 dir, so pgadmin doesn't even know about Postgres 9.0 existance... Nevertheless, removing PostgreSQL 8.4 is enough for Webmin which uses /etc/postgresql/*/... paths, so there is no need for changes in Webmin config. In pgadmin I changed only port number and everything works fine.

Maybe that's good opportunity for me to (finally) make TKLPatch... ;) I'll post it when it's made.

Jeremy Davis's picture

I reckon this would be a great 'virgin' patch as it's pretty straight forward. There are lots of resources regarding TKLPatch but if you get stuck please don't hesitate to ask.

Jason Adams's picture

So did that TKLPatch ever get created? I'm in a situation where I could really use a feature introduced in Pg 9.0. Unfortunately I'm not as linux savvy as either involved in this thread, so a patch would be great. If not, could you explain in.. perhaps a touch more detail, how you went about switching over to 9.0? Did you lose the database in 8.4 and have to backup, or did you manage to keep what was there?


Jeremy Davis's picture

But if you follow my instructions above it will probably work fine. Although it'd pay to put a hold on the udev package so you avoid that issue.

echo udev hold | dpkg --set-selections

Add new comment