feat: add ALTER TABLE SET SCHEMA hook support#315
Open
sfc-gh-vparakh wants to merge 2 commits intomainfrom
Open
feat: add ALTER TABLE SET SCHEMA hook support#315sfc-gh-vparakh wants to merge 2 commits intomainfrom
sfc-gh-vparakh wants to merge 2 commits intomainfrom
Conversation
- Add PgLakeAlterTableSetSchemaHook hook point - Add PgLakeIsReplicationTargetHook to check if table is replication target - Bypass read-only check for SET SCHEMA on replication targets only
Collaborator
sfc-gh-okalaci
left a comment
There was a problem hiding this comment.
I wanted to share some context, as far as I know, the immediate goal is to support ALTER TABLE SET SCHEMA in snowflake_cdc.
For that case, I think we should not need pg_lake hooks: snowflake_cdc tracks source heap tables, so PostProcessAlterWritablePgLakeTableSchema wouldn't fire for the tables it tracks.
snowflake_cdc already intercepts this statement via HandleAlterObjectSchemaStmt, I thought we should fill-in the implementation there.
That said, this looks like it would be useful for pg_lake_replication. Do you maybe have plans on that side as well?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PgLakeAlterTableSetSchemaHookto allow replication extensions to handleALTER TABLE SET SCHEMAPgLakeIsReplicationTargetHookto skip read-only check for replication targetsPGDLLEXPORTfor shared library accessContext
This enables
pg_lake_replicationandsnowflake_cdcextensions to properly track table schema changes when tables are moved between schemas viaALTER TABLE SET SCHEMA.Test plan
snowflake_cdctest suite: all 8test_set_schematests pass