Skip to content

fix: reject cross-shard HAVING with an explicit error - #1906

Merged
murex971 merged 6 commits into
mainfrom
having-reject
Oct 27, 2026
Merged

murex971 merged 6 commits into
mainfrom
having-reject

Conversation

@murex971

@murex971 murex971 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Cross-shard queries with HAVING currently return wrong results without any error. The clause is sent unchanged to every shard, so each shard filters its own partial aggregates before PgDog merges them.

This PR rejects those queries with SQLSTATE 0A000 (feature not supported) until proper support lands.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@murex971
murex971 added this pull request to stack #1907 October 27, 2026 15:52
Base automatically changed from project-rewrite-refactor to main October 27, 2026 16:08
@murex971
murex971 requested a review from jkaczman October 27, 2026 18:06
Comment thread pgdog/src/frontend/client/query_engine/route_query.rs Outdated
@murex971
murex971 merged commit b66fc9e into main Oct 27, 2026
50 of 51 checks passed
@murex971
murex971 deleted the having-reject branch October 27, 2026 19:26
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