On Fri, 2025-09-12 at 15:45 +0200, Stephan Springl wrote:
> version 17.6 changed how similar works compared to version 17.5.
>
> With file f as
> cat >f <<END
> drop table t;
> create table t (p varchar (1));
> insert into t values ('_');
> select * from t;
> select * from t where p similar to '[\_]%';
> END
>
> psql -f f
>
> gives:
>
> DROP TABLE
> CREATE TABLE
> INSERT 0 1
> p
> ---
> _
> (1 row)
>
> p
> ---
> (0 rows)
>
> The expression with similar does not find the row. With version 17.5, the row
> was found, as wanted.
This bug was fixed in commit e09adb5b9f [1], and the fix will be shipped with
the next minor releases.
Yours,
Laurenz Albe
[1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e09adb5b9fc9dec27c7ff9e9592723d7d8098b03