Skip to content

PostgreSQL compatibility: regexp_replace should honor PostgreSQL multiline flag m #22258

Closed as not planned

Description

@Dandandan

Split out from #22247.

Mismatch

regexp_replace should honor PostgreSQL multiline flag m.

SELECT regexp_replace(E'a\nb', '^b', 'x', 'm');

PostgreSQL:

a
x

DataFusion:

a\nb

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
    memory D SELECT regexp_replace(E'a\nb', '^b', 'x', 'm');
    ┌────────────────────────────────────────┐
    │ regexp_replace('a\nb', '^b', 'x', 'm') │
    │                varchar                 │
    ├────────────────────────────────────────┤
    │ a\nb                                   │
    └────────────────────────────────────────┘
    

    duckdb/duckdb#17056

  2. Jefffrey commented on May 28, 2026

    @Jefffrey
    Contributor

    Can't reproduce on main

    DataFusion CLI v53.1.0
    > SELECT regexp_replace(E'a\nb', '^b', 'x', 'm');
    +-------------------------------------+
    | regexp_replace(Utf8("a              |
    | b"),Utf8("^b"),Utf8("x"),Utf8("m")) |
    +-------------------------------------+
    | a                                   |
    | x                                   |
    +-------------------------------------+
    1 row(s) fetched.
    Elapsed 0.059 seconds.
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