in reply to modifying fetchall_arrayref({}) result
You could create a YourDBI module which inherits from DBI and override only the method you care about. I think doing it in the database is better but this is an alternate solution in case your db doesn't allow that.