On Wed, Sep 13, 2017 at 12:12 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com
> wrote:
>
> Foreign tables do not have physical storage assigned to by default. At
> least heap_create() tells so, create_storage being set to false for a
> foreign table. So there is nothing to clean up normally. Or is
> cstore_fdw using directly heap_create with its own relfilenode set,
> creating a physical storage?
>
cstore_fdw (in store_data_in_internal_storage branch) calls
RelationCreateStorage() after CREATE FOREIGN TABLE completes [1]. Later it
also creates the FSM fork and uses it for storing some metadata.
[1]
https://github.com/citusdata/cstore_fdw/blob/store_data_in_internal_storage/cstore_fdw.c#L237