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

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: Latest patches break one of our unit-test, related to RLS
Date: 2025-09-12 13:57:45
Message-ID: CAFCRh-9KdBrOHcdCddQGWi_wFSWD=Hmr9VG61YoJ2AkzahnaKQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 12, 2025 at 3:54 PM jian he <jian(dot)universality(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-09-12 14:07:06 Re: Latest patches break one of our unit-test, related to RLS
Previous Message jian he 2025-09-12 13:53:34 Re: Latest patches break one of our unit-test, related to RLS