Fix raw_sql for postgresql