Also, you've defined `fetch_returned_values()` for Postgres as `cursor.fetchone()`, which is wrong when many rows are expected.