Re: Latest patches break one of our unit-test, related to RLS

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Latest patches break one of our unit-test, related to RLS
Date: 2025-09-12 13:34:58
Message-ID: CAFCRh-_U+8fmRoc-sYM5ahp=9dNjs=Dri1LFLcHCgEJX8Zq_oA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 12, 2025 at 3:29 PM Dominique Devienne <ddevienne(at)gmail(dot)com> wrote:
> On Fri, Sep 12, 2025 at 3:24 PM Dominique Devienne <ddevienne(at)gmail(dot)com> wrote:
> > On Fri, Sep 12, 2025 at 3:11 PM Dominique Devienne <ddevienne(at)gmail(dot)com> wrote:
>
> > So I don't see how my `... where v similar to 'foo[\d\w]_%'` is incorrect.
> > So again, is this a bug / regression or not? Thanks, --DD
>
> If I use (x|y) instead of [xy] it seems to behave correctly.
> Whether x is the full-length POSIX class, or the shorthand notation.
> This DOES look like a bug, no? I've done regexes for a long time,
> and these two forms should be equivalent IMHO. --DD
>
> postgres=# show server_version;
> server_version
> ----------------
> 18rc1
> (1 row)
>
>
> postgres=# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar'))
> select v from t where v similar to 'foo[\d\w]_%';
> v
> ---
> (0 rows)
>
>
> postgres=# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar'))
> select v from t where v similar to 'foo[[[:digit:]][[:word:]]]_%';
> v
> ---
> (0 rows)
>
>
> postgres=# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar'))
> select v from t where v similar to 'foo([[:digit:]]|[[:word:]])_%';
> v
> ---------
> foo0bar
> (1 row)
>
>
> postgres=# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar'))
> select v from t where v similar to 'foo(\d|\w)_%';
> v
> ---------
> foo0bar
> (1 row)

For completeness:

postgres=# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar'))
select v from t where v similar to 'foo[0-9a-zA-Z]_%';
v
---------
foo0bar
(1 row)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jian he 2025-09-12 13:53:34 Re: Latest patches break one of our unit-test, related to RLS
Previous Message Dominique Devienne 2025-09-12 13:29:33 Re: Latest patches break one of our unit-test, related to RLS