Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are running a legacy application which requires PostgreSQL 8.2 on Debian Etch. Since Debian dropped support for etch, we're seriously considering to upgrade to Debian Lenny. However, we are stuck if we will be able to continue to run PostgreSQL 8.2 on Debian Lenny.

Therefore, is it possible to continue to run PostgreSQL 8.2 (not upgrade and perhaps pin it) on a Debian Lenny system, which will be upgraded from Debian Etch? If so, how?

share|improve this question

It is possible to run (practically) any version of Postgres on (almost) any unix-like system -- Simply grab the source code from the Postgres web site and compile it (detailed instructions here).
If you're feeling ambitious you can follow the packaging instructions for your operating system as well and install your downgraded database as a package, but you can skip that step just as easily with few ill effects.

It is probably best to compile/install the old version in a unique path (/opt/postgres82, /usr/local/postgres82, etc.) to ensure that your OS won't stomp on it.

Note that when going this route you need to be aware of when underlying libraries change (which could break your database server if Postgres is linked against the library, necessitating a re-compile), and you will probably need to install your own startup script in a way appropriate to your operating system.

share|improve this answer
Thank you @voretaq7, I'm aware of compiling from source. However, as you wrote in detail, choosing the home-made way is far expensive in terms of maintenance. – Lashae Feb 17 '11 at 7:55
You also have the option to statically link Postgres if you compile it yourself -- This makes the Postgres binaries substantially larger, but avoids the "Stuff broke because packages got upgraded" issue... – voretaq7 Feb 17 '11 at 15:27

If you just upgrade from etch to lenny, your installed postgresql-8.2 package isn't going to disappear. That's how it's designed. (Check the aptitude output when you're upgrading to be sure. You could set the package to hold if needed, but it shouldn't be needed.)

share|improve this answer
This is the real good news Peter! Just to be sure, how am I supposed to configure aptitude to hold PostgreSQL at 8.2? – Lashae Feb 17 '11 at 8:10
aptitude hold postgresql-8.2 – Peter Eisentraut Feb 17 '11 at 8:46
The only issue here is what other packages are going to be held to satisfy dependencies (and which parts of the system may not be able to upgrade because of that) -- You also don't get the benefits of security fixes in major version bumps of shared libraries if you go this route unless they were backported, which may or may not be important in your environment... – voretaq7 Feb 17 '11 at 15:26
Well, try it out. It should work, but you can probably construct a scenario where it won't. – Peter Eisentraut Feb 17 '11 at 19:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.