Make filters and ordering follow PostgreSQL comparison semantics

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
postgresql, rust
Domain
backend, databases

Research direction

Start by locating the engine’s filter comparison and ORDER BY code, then read how it represents PostgreSQL types, collations, enums, and NULL values. Add cases that compare engine results with PostgreSQL for each listed behavior, including NaN, empty NOT IN, and LIMIT ordering. Done means all acceptance criteria pass; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Description

Problem

Some filters and ordering operations do not match PostgreSQL:

  • Types not modeled by the engine (including interval, inet, cidr, macaddr, timetz, and ranges) are compared as text.
  • citext, char(n), and text using nondeterministic collations are compared byte by byte.
  • Text range filters and ORDER BY use byte order even when the column’s collation sorts differently (for example, en_US).
  • Enum range filters and ORDER BY sort labels as text instead of following enum declaration order.
  • Float NaN never matches a range condition.
  • x NOT IN () omits rows where x is NULL, though PostgreSQL returns every row for an empty list.
  • With ORDER BY … LIMIT, rows with NULL sort values can be excluded from the limited window even when PostgreSQL would include them.

Expected behavior

Filters and ordering should produce results consistent with PostgreSQL for these types, collations, NULL values, and edge cases.

Acceptance criteria

  • Comparisons for the listed types match PostgreSQL semantics, or unsupported types are handled explicitly rather than silently compared as text.
  • Text comparison and ordering respect the column’s collation and type.
  • Enum comparisons and ordering respect declaration order.
  • NaN, empty NOT IN lists, and NULL ordering with LIMIT match PostgreSQL.
  • Tests compare engine results with PostgreSQL results for the cases above.
Dominant language
Rust
Stars
129
Forks
7
Avg merge
1d 19h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from juspay/streamgres

All issues in juspay/streamgres

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.