Commit 0044e03
authored
fix: Improvements to SET search_path for postgres explain plans (#5422)
### 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 updated1 parent 79e138d commit 0044e03
File tree
2 files changed
+8
-8
lines changed- internal/component/database_observability/postgres/collector
2 files changed
+8
-8
lines changedLines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
571 | 576 | | |
572 | 577 | | |
573 | 578 | | |
| |||
581 | 586 | | |
582 | 587 | | |
583 | 588 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2915 | 2915 | | |
2916 | 2916 | | |
2917 | 2917 | | |
| 2918 | + | |
2918 | 2919 | | |
2919 | | - | |
2920 | 2920 | | |
2921 | 2921 | | |
2922 | 2922 | | |
| |||
2982 | 2982 | | |
2983 | 2983 | | |
2984 | 2984 | | |
| 2985 | + | |
2985 | 2986 | | |
2986 | | - | |
2987 | 2987 | | |
2988 | 2988 | | |
2989 | 2989 | | |
| |||
3049 | 3049 | | |
3050 | 3050 | | |
3051 | 3051 | | |
| 3052 | + | |
3052 | 3053 | | |
3053 | | - | |
3054 | 3054 | | |
3055 | 3055 | | |
3056 | 3056 | | |
| |||
0 commit comments