Dear Maintainers, This bug is still present in trixie trac package 1.6-3. It is also not fixed in debian unstable 1.6-5.
Updated posgtres_backend.py with fix is available in 1.6-stable trac repository:
https://svn.edgewall.org/repos/trac/branches/1.6-stable/trac/db/postgres_backend.py

