FDW: should GetFdwRoutine be called when drop table? - Mailing list pgsql-hackers

From Feng Tian
Subject FDW: should GetFdwRoutine be called when drop table?
Date
Msg-id CAFWGqntMqT6Mkjbxgu9MMFxwzCOrixYgGXH5-82QQ4a-ZSyybw@mail.gmail.com
Whole thread Raw
Responses Re: FDW: should GetFdwRoutine be called when drop table?
List 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
   


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL Audit Extension
Next
From: piyush patil
Date:
Subject: Google Summer of Code