Skip to content

Commit

Permalink
need explict cast on regexp_like() parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Nov 30, 2023
1 parent 381fd1a commit 9a1f9e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nominatim/db/sqlalchemy_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class RegexpWord(sa.sql.functions.GenericFunction[Any]):
@compiles(RegexpWord, 'postgresql') # type: ignore[no-untyped-call, misc]
def postgres_regexp_nocase(element: RegexpWord, compiler: 'sa.Compiled', **kw: Any) -> str:
arg1, arg2 = list(element.clauses)
return "regexp_like(%s, '\\m(' || %s || ')\\M', 'i')" % (compiler.process(arg2, **kw), compiler.process(arg1, **kw))
return "regexp_like(%s, '\\m(' || %s || ')\\M', 'i'::text)" % (compiler.process(arg2, **kw), compiler.process(arg1, **kw))

@compiles(RegexpWord, 'sqlite') # type: ignore[no-untyped-call, misc]
def sqlite_regexp_nocase(element: RegexpWord, compiler: 'sa.Compiled', **kw: Any) -> str:
Expand Down

0 comments on commit 9a1f9e3

Please sign in to comment.