Re: SQL/MED estimated time of arrival? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQL/MED estimated time of arrival?
Date
Msg-id 19495.1289057369@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL/MED estimated time of arrival?  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> And if we really make this async query come true, I suggest designing
> resource (i.e. remote connection) management very carefully. When the
> executor fails in the middle of its execution, it possibly fails to
> release its own resource; close() in ExecutorEnd() will never be
> called. As far as I know files and memory are released automatically
> in the current mechanism, but MED APIs will use their own resources
> other than them.

The way to fix that is for the FDW to hook into the ResourceOwner
mechanism (via RegisterResourceReleaseCallback).  Then it can track
and clean up things it knows about just as "automatically" as anything
else is.

Of course, if you lose your network connection to the remote DB,
you have to assume it will clean up of its own accord.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Yeb Havinga
Date:
Subject: Re: Fix for seg picksplit function
Next
From: Bruce Momjian
Date:
Subject: PL/pgSQL and shared_preload_libraries