Itagaki Takahiro <itagaki.takah...@oss.ntt.co.jp> writes: > Joe Conway <m...@joeconway.com> wrote: >> Please see if this works for you.
> It does not work because errors can occur in caller of dblink functions; > Error callback should be still registered after SRF_RETURN_NEXT, so we > cannot place callback context on stack of the function. More works needed. Yeah, I meant to comment on that: it's an abuse of the error context mechanism and will never be safe. (An example is that if someone innocently did an elog(LOG) or something like that, the callback would get triggered.) The global PGresult value seems awfully dangerous too. I think what you want to do instead is use PG_TRY blocks to ensure that transient results are cleaned up. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers