You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make age extension usable from shared_preload_libraries
When AGE is loaded via shared_preload_libraries, its hooks
(post_parse_analyze, set_rel_pathlist, object_access) are active
before CREATE EXTENSION age is run. This causes errors when
non-Cypher queries trigger those hooks and ag_catalog does not
yet exist.
Changes:
- Add is_age_extension_exist() with a relcache callback cache so that
checking pg_extension is not repeated on every hook invocation.
- Guard post_parse_analyze, set_rel_pathlist, and object_access hooks
with is_age_extension_exist() so they become no-ops when the
extension is not installed.
- Refactor ag_ProcessUtility_hook to detect CREATE/DROP EXTENSION age
and broadcast a relcache invalidation via
CacheInvalidateRelcacheByRelid(ExtensionRelationId) so other
backends update their cached extension state.
- Wrap DROP EXTENSION processing in PG_TRY/PG_CATCH to restore
object_access_hook if the drop fails (e.g. dependent objects).
- Skip _PG_init during pg_upgrade (IsBinaryUpgrade) to avoid hook
registration when the binary-upgrade machinery is running.
- Add regression tests that verify hooks do not error when ag_catalog
schema is absent.
0 commit comments