I wrote the below to get message content for specified user for date range, we have a few DBs that hold messages (user, group, chat room, etc). A bit of a hack, but my PG not up to par as it is with Oracle, Sybase and MSSQL. I get each by direction...