serdarmumcu opened a new pull request, #2438:
URL: https://github.com/apache/age/pull/2438

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to