Add support for UPDATE ... RETURNING statements in PostgreSQL

An improved version of PR #2629.
Also removes REPLACE from the regular expression, as it is not supported by PostgreSQL.