Debian's postgresql packages are designed to be installable side by side, with
pg_*cluster commands for controlling them, which makes installing from a .deb a great idea. Unfortunately it looks like hardy (8.04) was the last version of Ubuntu to package postgresql-8.2 (in universe), I'm certain that the libraries it was compiled against are different than what you've got now, and would probably conflict against what you have if you tried to just install the package.
The easiest way to rebuild the package would be to add
deb-src lines to your sources for Hardy:
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-security universe
Then, after an
apt-get update, you should use
apt-get build-dep postgresql-8.2 to install all the build dependencies. If something can't be found at all in Maverick, you're going to have to make a judgement call on whether the package changed its name and install it by hand, or build that package from source too. Once you have all the build dependencies installed,
apt-get source --compile postgresql-8.2 will fetch the source and build debian packages for all of these, using the library versions found in Maverick.