Re: Latest patches break one of our unit-test, related to RLS - Mailing list pgsql-general

From Dominique Devienne
Subject Re: Latest patches break one of our unit-test, related to RLS
Date
Msg-id CAFCRh-9KdBrOHcdCddQGWi_wFSWD=Hmr9VG61YoJ2AkzahnaKQ@mail.gmail.com
Whole thread Raw
In response to Re: Latest patches break one of our unit-test, related to RLS  (jian he <jian.universality@gmail.com>)
List pgsql-general
On Fri, Sep 12, 2025 at 3:54 PM jian he <jian.universality@gmail.com> wrote:
> > > select v from t where v similar to 'foo[\d\w]_%';
> > > select v from t where v similar to 'foo[[[:digit:]][[:word:]]]_%';

> The above two examples are the same, per
> (Table 9.21. Regular Expression Class-Shorthand Escapes)

Of course.

> my guess why 'foo0bar' will fail for 'foo[[[:digit:]][[:word:]]]_%';
> 1. process character 0, it does meet [[:digits]] character class.
> 2. process character b, it does not meet [[:digits]], then fails,
> it won't check again whether character b is satisfied with [[:word:]] or not.

Then you don't know what [...] means in regexes I'm afraid. --DD



pgsql-general by date:

Previous
From: jian he
Date:
Subject: Re: Latest patches break one of our unit-test, related to RLS
Next
From: Tom Lane
Date:
Subject: Re: Latest patches break one of our unit-test, related to RLS