Skip to content

PostgreSQL compatibility: SIMILAR TO should treat % as a wildcard #22263

Closed

Description

@Dandandan

Split out from #22247.

Mismatch

SIMILAR TO should treat % as a wildcard.

SELECT 'abc' SIMILAR TO 'a%';

PostgreSQL:

true

DataFusion:

false

Expected behavior

For PostgreSQL-compatible SQL semantics, DataFusion should either match PostgreSQL's result or raise the same class of domain/semantic error.

Activity

  1. kumarUjjawal commented on May 18, 2026

    @kumarUjjawal
    Contributor

    DuckDb

    memory D SELECT 'abc' SIMILAR TO 'a%';
    ┌────────────────────────────────┐
    │ regexp_full_match('abc', 'a%') │
    │            boolean             │
    ├────────────────────────────────┤
    │ false                          │
    └────────────────────────────────┘
    

    duckdb/duckdb#17056

  2. oc7o commented on Jun 25, 2026

    @oc7o
    Contributor

    I submitted a PR for this. Feel free to review ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions