Fixes #2165 sendthread.php throws sql error with postgres