-
-
Notifications
You must be signed in to change notification settings - Fork 122
chore: Warn on generated columns #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
generated columns are not supported in logical replication for PostgreSQL versions < 18
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
iambriccardo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, however adding this check within the CTE seems to add unnecessary complexity.
I would rather just add a separate query that emits the warning before querying the actual column schemas. This way it's separate and clearer.
| "Table {} contains generated columns that will NOT be replicated. \ | ||
| Generated columns are not supported in PostgreSQL logical replication and will \ | ||
| be excluded from the ETL schema. These columns will NOT appear in the destination.", | ||
| table_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured that keeping at least the table_id in the warn message would be helpful and at no performance cost
Fixes #71
What kind of change does this PR introduce?
Prints a warning upon detecting generated columns.
What is the current behavior?
No warnings and user might not be aware that generated columns are being ignored from publication.
What is the new behavior?
Warns users about generated columns being excluded from the publication. For each table with a detected generated column, a warn message like so will be displayed:
Additional context
Tested with PostgreSQL 17.6