Skip to content

Schema-qualify functions/types/etc in our SQL wherever possible - #418

Merged
Thom Chiovoloni (thomcc-work) merged 2 commits into
mainfrom
thomcc/schema-qualified
Oct 7, 2026
Merged

Thom Chiovoloni (thomcc-work) merged 2 commits into
mainfrom
thomcc/schema-qualified

Conversation

@thomcc-work

Copy link
Copy Markdown
Contributor

In #401 (comment) I mentioned I would make a PR that schema-qualified everything. This is being a little paranoid, but accidentally running a user-controlled function when we shouldn't would be a big problem for us, so this is good to do defensively.

This also updates our copilot instructions so that agents maintain this convention.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Broad security-sensitive SQL changes need human confirmation of PostgreSQL runtime and backward-compatibility validation.

Review effort: Balanced
Findings: None

What changed in this PR

Hardens pg_durable’s internal SQL against caller-controlled search_path settings while preserving user-authored SQL and replay-sensitive output.

Changes:

  • Schema-qualifies runtime SQL objects, operators, and casts.
  • Adds hostile-search-path regression coverage.
  • Documents qualification rules and compatibility exceptions.
File Description
tests/​e2e/​sql/​89_schema_qualification.sql Tests public APIs with shadowed SQL objects.
src/​worker.rs Qualifies worker SQL and adds regression coverage.
src/​types.rs Hardens catalog queries; documents replay-sensitive SQL spelling.
src/​origin.rs Qualifies installation identity casts.
src/​node_status.rs Qualifies status-details checks and casts.
src/​monitoring.rs Qualifies monitoring queries and pagination expressions.
src/​explain.rs Qualifies instance and graph lookups.
src/​endpoints.rs Qualifies endpoint catalog comparisons.
src/​dsl.rs Qualifies variable, submission, and lifecycle SQL.
src/​client.rs Qualifies the caller-database cast.
src/​activities/​update_node_status.rs Qualifies node-status updates and metadata checks.
src/​activities/​update_instance_status.rs Qualifies timestamps and terminal-state comparisons.
src/​activities/​load_function_graph.rs Qualifies graph-loading and transaction-visibility SQL.
src/​activities/​execute_http.rs Qualifies types in HTTP privilege-check signatures.
.github/​copilot-instructions.md Documents qualification and compatibility guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thomcc-work

Copy link
Copy Markdown
Contributor Author

I'm snarfing the test change from #416.

Run committed counterfeit metadata regressions in unique private databases, preserve shared df.start availability, and verify cleanup preserves assertion failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@thomcc-work
Thom Chiovoloni (thomcc-work) force-pushed the thomcc/schema-qualified branch 2 times, most recently from 22f0d14 to fb2ed86 Compare October 6, 2026 19:56
@thomcc-work
Thom Chiovoloni (thomcc-work) merged commit 584298d into main Oct 7, 2026
9 of 17 checks passed
@thomcc-work
Thom Chiovoloni (thomcc-work) deleted the thomcc/schema-qualified branch October 7, 2026 00:39
Gokhan Gulbiz (gokhangulbiz) pushed a commit that referenced this pull request Oct 7, 2026
Cover merged PR #418 and its binary, schema and replay compatibility considerations; refresh the planned release date.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Thom Chiovoloni (thomcc-work) pushed a commit that referenced this pull request Oct 7, 2026
…ening (#417)

* Prepare v0.2.9 release documentation

Curate release history and upgrade guidance while preserving deferred runtime shutdown and server-side quiescence limitations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Include SQL name-resolution hardening in v0.2.9 release notes

Cover merged PR #418 and its binary, schema and replay compatibility considerations; refresh the planned release date.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Gokhan Gulbiz <gokhangulbiz@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants