Currently the database tests only contain most of the SELECT-queries.
UPDATEs and INSERTs are still missing.
Attached is the result for Postgres 8.4. It looks like you have to add an order an in the SELECT query.
The coding style, especially those complex arrays, look rather suboptimal.
Maybe add "$sql =" for each query, maybe open/close arrays with multiple subarrays on its own line.
Added PHPBB3-9625 to the commit messages.