Re: [HACKERS] [PATCH] Call RelationDropStorage() for broader range ofobject drops. - Mailing list pgsql-hackers

From Hadi Moshayedi
Subject Re: [HACKERS] [PATCH] Call RelationDropStorage() for broader range ofobject drops.
Date
Msg-id CA+_kT_c83hxpzym+EYC2QovEbonkJ_NGGHG3H970qtctZvPVVQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Call RelationDropStorage() for broader range ofobject drops.  (Hadi Moshayedi <hadi@citusdata.com>)
Responses Re: [HACKERS] [PATCH] Call RelationDropStorage() for broader rangeof object drops.
List pgsql-hackers
To provide more context, in cstore_fdw creating the storage is easy, we only need to hook into CREATE FOREIGN TABLE using event triggers. Removing the storage is not that easy, for DROP FOREIGN TABLE we can use event triggers. But when we do DROP EXTENSION, the event triggers don't get fired (because they have already been dropped), so to handle DROP EXTENSION, we need to hook into the process utility hook. Now to implement this, (1) we get a list of all cstore tables (2) call postgres's utility hook, (3) if #2 succeeds clean-up all cstore table storage's. But when #3 happens the relation isn't there anymore, so we create a pseudo-relation [1] and call RelationDropStorage().

Implementing all of this seemed messy, so we thought maybe postgres could try to clean-up storage for every relation it assigns a relfilenode for. We are open to ideas.


pgsql-hackers by date:

Previous
From: Hadi Moshayedi
Date:
Subject: Re: [HACKERS] [PATCH] Call RelationDropStorage() for broader range ofobject drops.
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] GatherMerge misses to push target list