Skip to content

Conversation

@caike
Copy link

@caike caike commented Nov 10, 2025

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:

2025-11-20T16:35:20.050149Z WARN apply_worker{pipeline_id=1 publication_name="full_pub"}:table_sync_worker{pipeline_id=1 publication_name="full_pub" table_id=16393}: etl::replication::client: Table 16393 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.

Additional context

Tested with PostgreSQL 17.6

generated columns are not supported in logical replication for
PostgreSQL versions < 18
@caike caike requested a review from a team as a code owner November 10, 2025 15:58
@caike caike changed the title Warn on generated columns chore: Warn on generated columns Nov 10, 2025
@iambriccardo
Copy link
Contributor

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Copy link
Contributor

@iambriccardo iambriccardo left a 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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show users that generated columns are being filtered out

2 participants