fix: add assign hook for CDC library path adjustment
fix : #7715
According to the documentation and pg_settings, the context of the citus.enable_change_data_capture parameter is user.
However, changing this parameter — even as a superuser — doesn't work as expected: while the initial copy phase works correctly, subsequent change events are not propagated.
This appears to be due to the fact that dynamic_library_path is only updated to $libdir/citus_decoders:$libdir when the server is restarted and the _PG_init function is invoked.
To address this, I added an EnableChangeDataCaptureAssignHook that automatically updates dynamic_library_path at runtime when citus.enable_change_data_capture is enabled, ensuring that the CDC decoder libraries are properly loaded.
Note that dynamic_library_path is already a superuser-context parameter in base PostgreSQL, so updating it from within the assign hook should be safe and consistent with PostgreSQL’s configuration model.
If there’s any reason this approach might be problematic or if there’s a preferred alternative, I’d appreciate any feedback.
DESCRIPTION: Automatically updates dynamic_library_path when CDC is enabled