Fix *ambigious match found* exception for PostgreSQL.