I tried it out and felt good about this feature. But I found that the following information is not very complete.
postgres=# select * from pg_get_loaded_modules(); module_name | version | file_name --------------+---------+------------------- | | pg_overexplain.so auto_explain | 18devel | auto_explain.so plpgsql | 18devel | plpgsql.so (3 rows) Some minor changes may be needed. // PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT( .name = "pg_overexplain", .version = PG_VERSION );