Server side cursor psycopg2. cursor(name='cursor_name .