You don't need the "from dual", either ... the "from" clause is optional in PG. We only supply dual so we can use unmodified queries more frequently, but since db_nextval is already different in Oracle and PG might as well leave it off entirely. This will speed up the nextval query just a bit ...