Fix SQL syntax error for PostgreSQL.

pgsql only support "LIMIT ... OFFSET ..." syntax.