Rewrite dblink_record_internal() and dblink_fetch() to use a tuplestore
Joe Conway <mail@joeconway.com>
Rewrite dblink_record_internal() and dblink_fetch() to use a tuplestore (SFRM_Materialize mode) to return tuples. Since we don't return from the dblink function in tuplestore mode, release the PGresult with a PG_CATCH block on error. Also rearrange to share the same code to materialize the tuplestore. Patch by Takahiro Itagaki.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/dblink/dblink.c | modified | +232 −337 |