Using PostgreSQL cursors in the etl scenario