Vladimir Sitnikov <sitnikov.vladimir@gmail.com> writes:
> The backend materializes, so it is a sad thing.
> Is there a change "with hold" can be implemented without materialization?
That would not be an improvement. If we didn't materialize, then we'd
have to retain the locks held by the transaction, as well as keep global
xmin from advancing, so that the rows the cursor still needed to fetch
would not get cleaned by VACUUM nor would the tables containing them get
dropped or significantly altered. Either effect would be awful for
performance if the cursor was held for long. Moreover, keeping the locks
would effectively mean that the transaction wasn't really ended. So if
that's what you want, don't commit the transaction.
regards, tom lane