Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ux4EA-00APmH-Kd for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 13:54:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ux4E8-001S4w-HO for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 13:54:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ux4E8-001S4l-6r for pgsql-general@lists.postgresql.org; Fri, 12 Sep 2025 13:54:13 +0000 Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ux4E6-0002dG-2Y for pgsql-general@postgresql.org; Fri, 12 Sep 2025 13:54:12 +0000 Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-54487445158so623556e0c.3 for ; Fri, 12 Sep 2025 06:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757685250; x=1758290050; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OZ3B46R1wIfttmZhS5EBWQM7jftEL5FdSEYXQpNg+KQ=; b=l4lonefyIf2MvwJ4wr1cQdu6Bk+q/b8iqdjjfk1k/cw3z6AnQZyPOEnepI+jsgC+IY Qfjh+HwTrgHRmTVjJD+GTX84RYv4TSrao42KaOQVuuzpotDI/VIcugNrcy7kAuiG+pPe qlkwGA9TvzbPtQ6IMO6WkPpuTQ6g1QvzzoA6m0KXcXJkghrnPcCPoDetvrgQq5GJB8Wy Y70UHFM6l/kk4fEONslEGMWZ6+sWML0EcPwsJ+GIpvW2s8fY8e9cEM0mtTEqD2NJccfS oc+RW7mOrULwsErSdgiZW9IG5H3dLGaNTcCsGK4/iDnH01Y6bgVVIYuVAru6yF9E8Ymb M5dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757685250; x=1758290050; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OZ3B46R1wIfttmZhS5EBWQM7jftEL5FdSEYXQpNg+KQ=; b=AZZxF1QGPWowxufwGB77Uybdaf4Hjf6TgkMMdbWGrXuKBK021G3/NqqeaQKBYUMSyX xfuqL3tuZ7YPUJJRAOlniXnvwxwlFJLPgQF2M2NAV6WV36CGgSSOdhOZiE15olHf/t0D 9GpMKdk+KxSqboeHpmduTMsR0vMe30zC9evX42l0duYQ4QDKbAXQkTlEHYyykLd006sN XQt7GYGeTTgLzGE9bPaNazlK37hE2wE5dvgTp7KUp97O+zHJrnjQN8O+MiUOOtB9JMJD tMGE8HmZNkskmtozIW18QB5KR8yJguzu1ANOEu89fT+LXAQUrwFC52QBszSSRq6qAVj3 6xFA== X-Forwarded-Encrypted: i=1; AJvYcCXvv/PY56WbtqMwaje/CW5Pt7EfPcpRAyIx3e3IA0wAjqLF90oP3vMSt8yA8jniykr4bs1fjL2N7K3w0z6N@postgresql.org X-Gm-Message-State: AOJu0YzqFsW8HYbTmufJPqcUIeALjChuuweaiKTcslM1nwAawNQR1nGr T0O6+Sg3+Sm35OqseFxCgg9+LHQds6mlStgOdzhm6o20oqKJX8Q//JKvBMR67jMZ4ywZQVzNVcT WMNFhpXy6CxJ1wIaO1rBzCK9Tf0tgd+glYCZkF/37nA== X-Gm-Gg: ASbGnctI0tRquxVMlktoalJl4E3u/mqPZiiIS/YC+mAdAZltWhDJmRG2HlNGz/gg9Hs U5PEIi1v25HYNjH2JSytIDfl8E8WbSlWNTwII6bkbF0XoTVoKv/q9os/pjq+KY68oMjQCdVu9n+ QVaFSJUOvGs0HNeL9ivDdiIUNCcuAebitrgAYK0Ap50v2VACwJfXDLDilQjaFCrX9jy5ywYQBwZ qPFQedzcczjXdF7uvgM9TNYTJygQqeEh/8/egA= X-Google-Smtp-Source: AGHT+IGIj+zdat+zkcIiQObUQ8uE17kqin6+ClTMTOJXW3vSQcEWyU84OvuO8peH8kZxxKV5+xJvJBm2q23Gzw6v2nY= X-Received: by 2002:a05:6122:2194:b0:543:6991:8f63 with SMTP id 71dfb90a1353d-54a16bf3a3cmr949372e0c.7.1757685250199; Fri, 12 Sep 2025 06:54:10 -0700 (PDT) MIME-Version: 1.0 References: <77a63548783dd4007ee479a4c5ed300629aaa776.camel@cybertec.at> In-Reply-To: From: jian he Date: Fri, 12 Sep 2025 21:53:34 +0800 X-Gm-Features: AS18NWDDYQIg9dNdNRU3_t4RUd7v6Q4ngFgYMMR0SG9t7rOPY-p57saPPDL8Ajw Message-ID: Subject: Re: Latest patches break one of our unit-test, related to RLS To: Dominique Devienne Cc: Laurenz Albe , pgsql-general@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 12, 2025 at 9:35=E2=80=AFPM Dominique Devienne wrote: > > On Fri, Sep 12, 2025 at 3:29=E2=80=AFPM Dominique Devienne wrote: > > On Fri, Sep 12, 2025 at 3:24=E2=80=AFPM Dominique Devienne wrote: > > > On Fri, Sep 12, 2025 at 3:11=E2=80=AFPM Dominique Devienne wrote: > > > > > So I don't see how my `... where v similar to 'foo[\d\w]_%'` is incor= rect. > > > 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=3D# show server_version; > > server_version > > ---------------- > > 18rc1 > > (1 row) > > > > > > postgres=3D# 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=3D# with t(v) as (values ('foo:bar'), ('foo/bar'), ('foo0bar')= ) > > select v from t where v similar to 'foo[[[:digit:]][[:word:]]]_%'; > > v > > --- > > (0 rows) > > The above two examples are the same, per (Table 9.21. Regular Expression Class-Shorthand Escapes) https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-S= IMILARTO-REGEXP 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 no= t.