Skip to content

PostgreSQL compatibility: regexp_instr with an empty pattern should return 1 #22257

Closed

Description

@Dandandan

Split out from #22247.

Mismatch

regexp_instr with an empty pattern should return 1.

SELECT regexp_instr('abc', '');

PostgreSQL:

1

DataFusion:

0

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. toby-bridges commented on May 17, 2026

    @toby-bridges

    I’m taking a look at this one. I’m going to verify the current regexp_instr empty-pattern behavior locally and, if it stays narrowly scoped, send a small fix with tests.

  2. Jefffrey commented on May 26, 2026

    @Jefffrey
    Contributor

    I think it makes sense to implement this fix given the original PR was using postgres as a reference:

    And Spark seems to agree

  3. added a commit that references this issue on Aug 4, 2026
    f248f45
  4. added a commit that references this issue on Aug 12, 2026
    87f87cc
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

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions