database_observability: fix schema_details collector to fetch column definitions with case sensitive table names#4872
Merged
fridgepoet merged 4 commits intomainfrom Nov 19, 2025
Conversation
fridgepoet
commented
Nov 18, 2025
| ) | ||
|
|
||
| func TestConnectionInfo(t *testing.T) { | ||
| defer goleak.VerifyNone(t) |
Contributor
Author
There was a problem hiding this comment.
Three tests were failing locally if I ran them with -count=2 because of this. Just a drive-by improvement but can remove this from the PR if we prefer.
fridgepoet
commented
Nov 19, 2025
|
|
||
| - `loki.source.api` no longer drops request when relabel rules drops a specific stream. (@kalleep) | ||
|
|
||
| - (_Public Preview_) Additions to `database_observability.postgres` component: |
Contributor
Author
There was a problem hiding this comment.
Put this under Next > Bugfixes and with an Public Preview tag. Is that right?
matthewnolf
approved these changes
Nov 19, 2025
dehaansa
pushed a commit
to madhub/alloy
that referenced
this pull request
Dec 10, 2025
…definitions with case sensitive table names (grafana#4872)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Description
This PR modifies the select column query to look up table name from pg_class and schema from pg_namespace, preserving any case sensitivity of the table name.
Previously, the lookup was done with a cast
::regclass.::regclasslowercases unquoted identifiers, so if the table was created with mixed case, the lookup failed.For example:
If a table like
public.SomeMixedCaseNameexists, then the previous code would fail with an error message like:level=error msg="failed to get table definitions" component_path=/ component_id=database_observability.postgres.postgres_postgres_db collector=schema_details database=some_db schema=public err="pq: relation \"public.somemixedcasename\" does not exist"Notes to the Reviewer
PR Checklist