Skip to content
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

feat(outputs.postgresql): Allow limiting of column name length #16041

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Oct 18, 2024

Summary

PostgreSQL imposes a identifier length limit, leading to errors if column names (derived from field or tag names) are too long. Currently the default limit is 63 characters.

To allow cutting-off too long column names, this PR introduces a new option where you can set the cut-off limit. However, this should be used with care as it might cause column name collision if the differentiating part of column names is beyond the given limit.

Furthermore, the PR also limits logging the "too long" error to once per column name.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15964

@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Oct 18, 2024
@srebhan srebhan self-assigned this Oct 18, 2024
@srebhan srebhan changed the title feat(outputs.postgres): Allow limiting of column names feat(outputs.postgresql): Allow limiting of column names Oct 18, 2024
@srebhan srebhan changed the title feat(outputs.postgresql): Allow limiting of column names feat(outputs.postgresql): Allow limiting of column name length Oct 18, 2024
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 4, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Nov 4, 2024
@telegraf-tiger
Copy link
Contributor

@DStrand1 DStrand1 merged commit 3b705f2 into influxdata:master Nov 13, 2024
31 checks passed
@github-actions github-actions bot added this to the v1.33.0 milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/postgresql feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[outputs_postgresql] Problem with long column name
2 participants