Attached is an improved patch attempt, tested on Squeeze. Moodle does not need to pre-depend on anything, but should depend on pgsql or mysql because the host database needs to be setup before Moodle can be configured.
Jeremy
moodle_1.8.2.dfsg-5.1.debdiff
Description: Binary data