FDW: should GetFdwRoutine be called when drop table?

From: Feng Tian <ftian(at)vitessedata(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: FDW: should GetFdwRoutine be called when drop table?
Date: 2016-02-19 17:21:10
Message-ID: CAFWGqntMqT6Mkjbxgu9MMFxwzCOrixYgGXH5-82QQ4a-ZSyybw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Hackers,

I have an fdw that each foreign table will acquire some persisted resource.
In my case, some files in file system. To drop the table cleanly, I have
written
an object_access_hook that remove those files. The hook is installed in
_PG_init.

It all worked well except one case. Suppose a user login, the very first
command is
drop foreign table. Drop foreign table will not load the module, so that
the hook
is not installed and the files are not properly cleaned up.

Should drop foreign table call GetFdwRoutine? _PG_init is the only
entrance point
that I know for registering hooks, I feel we need to trigger a load for all
DML/DDL on
FDW including drop. Does this make sense?

Thanks,
Feng

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message piyush patil 2016-02-19 17:29:55 Google Summer of Code
Previous Message Bruce Momjian 2016-02-19 16:59:53 Re: PostgreSQL Audit Extension