Skip to content

fix(database_observability.postgres): Improvements to SET search_path for postgres explain plans#5422

Merged
rgeyer merged 1 commit intomainfrom
rgeyer/fix/dbo11y-explain-search_path
Feb 2, 2026
Merged

fix(database_observability.postgres): Improvements to SET search_path for postgres explain plans#5422
rgeyer merged 1 commit intomainfrom
rgeyer/fix/dbo11y-explain-search_path

Conversation

@rgeyer
Copy link
Contributor

@rgeyer rgeyer commented Feb 2, 2026

Brief description of Pull Request

During dogfooding we discovered some cases where explain plans were failing to run due to missing or ambiguous schema names.

This PR addresses several small issues with the SET search_path command which is meant to address these issues.

Pull Request Details

  • Sets the search path first, before any other requests are issued, including creating the prepared statement.
  • Places the datname in double quotes to prevent syntax errors
  • Explicitly sets the search path for SESSION rather than depending upon the default.

PR Checklist

  • Tests updated

…ult. Put datname in double quotes when setting search_path. Set search path immediately before executing other commands.
@rgeyer rgeyer requested a review from a team as a code owner February 2, 2026 18:24
@rgeyer rgeyer changed the title dbo11y fixes for postgres explain plans - SET search_path fix dbo11y: improvements to SET search_path for postgres explain plans Feb 2, 2026
@rgeyer rgeyer changed the title fix dbo11y: improvements to SET search_path for postgres explain plans fix: dbo11y improvements to SET search_path for postgres explain plans Feb 2, 2026
@rgeyer rgeyer changed the title fix: dbo11y improvements to SET search_path for postgres explain plans fix: Improvements to SET search_path for postgres explain plans Feb 2, 2026
@rgeyer rgeyer merged commit 0044e03 into main Feb 2, 2026
47 of 50 checks passed
@rgeyer rgeyer deleted the rgeyer/fix/dbo11y-explain-search_path branch February 2, 2026 18:59
@grafana-alloybot grafana-alloybot bot mentioned this pull request Feb 2, 2026
@cristiangreco cristiangreco changed the title fix: Improvements to SET search_path for postgres explain plans fix(database_observability.postgres): Improvements to SET search_path for postgres explain plans Feb 12, 2026
@cristiangreco cristiangreco added the backport/v1.13 Backport to release/v1.13 label Feb 12, 2026
grafana-alloybot bot pushed a commit that referenced this pull request Feb 12, 2026
### Brief description of Pull Request
During dogfooding we discovered some cases where explain plans were
failing to run due to missing or ambiguous schema names.

This PR addresses several small issues with the `SET search_path`
command which is meant to address these issues.

### Pull Request Details

- Sets the search path first, before any other requests are issued,
including creating the prepared statement.
- Places the datname in double quotes to prevent syntax errors
- Explicitly sets the search path for SESSION rather than depending upon
the default.

### PR Checklist
- [x] Tests updated

(cherry picked from commit 0044e03)
cristiangreco pushed a commit that referenced this pull request Feb 12, 2026
… for postgres explain plans [backport] (#5520)

## Backport of #5422

This PR backports #5422 to release/v1.13.

### Original PR Author
@rgeyer

### Description
### Brief description of Pull Request
During dogfooding we discovered some cases where explain plans were
failing to run due to missing or ambiguous schema names.

This PR addresses several small issues with the `SET search_path`
command which is meant to address these issues.

### Pull Request Details

- Sets the search path first, before any other requests are issued,
including creating the prepared statement.
- Places the datname in double quotes to prevent syntax errors
- Explicitly sets the search path for SESSION rather than depending upon
the default.

### PR Checklist
- [x] Tests updated


---
*This backport was created automatically.*

Co-authored-by: Ryan Geyer <me@ryangeyer.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/v1.13 Backport to release/v1.13 frozen-due-to-age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants