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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
@telegraf-tiger
Copy link
Contributor

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[outputs_postgresql] Problem with long column name
1 participant