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 1ux3Yn-00AICz-CW for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 13:11:29 +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 1ux3Yi-00145V-UF for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 13:11:25 +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 1ux3Yi-00145E-Iw for pgsql-general@lists.postgresql.org; Fri, 12 Sep 2025 13:11:25 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ux3Yh-0002Hn-0c for pgsql-general@postgresql.org; Fri, 12 Sep 2025 13:11:24 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-30ccea94438so1266753fac.2 for ; Fri, 12 Sep 2025 06:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757682683; x=1758287483; 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=Gzu0zWL0CDsU7UhicFrHvnJVcX+EFZiCzCEX6J3ICp8=; b=RcPjJBx/URD+a8G3rv3fcTWJynRAfzzX7P+cnt9BDwOzJKdJWl1IRz/WNjd3SQ09xI P02mmhlINma/6eMyGZM55Towt+Gp+GGlSxD222sIFtym6sqsYPf7BNoKihkWxfr9HZ6h LlvFhxI+Q66e0jjbebH12u7B9zDHpDfKVSquwJ7XevMpJVLqVwz+IOAAiH7ER5RudRG5 uLokiLjB6IteQmI0NEV06hytJgH3b0ap+WGqDgRshQ/oaaArJBbl+Ee3AnF+PRaoi1qd NFdHoOA6CLvwY1r/6ZE/hNqa7qwrMkdERLL0KgqR/AOLjHqsJu6mKHaKBssGLw6V957h wllQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757682683; x=1758287483; 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=Gzu0zWL0CDsU7UhicFrHvnJVcX+EFZiCzCEX6J3ICp8=; b=QzToKpDA5KcfReRLxCadIbT14ZbdQgrUlPrY2Svc5+e2ER6dflzXzN7OchIfLAilom qKlXwV090yCfHQWQcHSo8nKUQu5Yl+cYKiT/D0fy9dWrZFIeaKRnH3P+j86YLUKhP2QM nhJdcg7TDzlnxHpZfiNJyJr3ZXNroeilz0+5LkxFtt1I1sFKFGW1UW2GxAsMwHh62ZCy NpoQVrBF2TjP/GcQTH09GundiNzDRfyqmXGoAtvIN2Q1ZcqwLlWSAAI77B0irCScj7Da oL7Y+dt+IIiAkpG0+jqKYQo4kn8ffq/dnvJQo1VNL3qO3xQZdxJwtkgdgepucsUyXAHs FRvA== X-Gm-Message-State: AOJu0YyIi2Ldt+qGOlIgtX6P8pSMZCRIguNvJoHOG46Uc5HHofDoyDN2 O8Lb4JF/cBJfqbgTg6dQDsAl3wAkEn63Jk9ARv29FLgaOsrEvCMHrC432pSrcLFMS2FNgMhGlHS d5KiVIGZO+jSE3WauLP+upGlbpoDC6oSzh4qD X-Gm-Gg: ASbGncugAc66F3qnY3Rg4/HbFGlgKffF99pE+JbUSH/u1Qet7bQGcTZASwNXYEQLApt nldwojkVaqWd8wp/8f3v0PaIz//ME3bCsaNOo9n9wD0BTZ41xm/zZolN4z7qpkQHDwniLvepclO MC7ikhPbFS+amxu7lyrVyiI4eL+pntw4PP9yIKuUuK3EPAjPwkIsPNj6rCzheTMVpl+1uwg1Qb6 JAuj4bm8BXiYHfIT1Mb X-Google-Smtp-Source: AGHT+IGiQEFPAGpYZY7KtfSkP380w9pVg4hOI1fnhqwgbKI6bProBcN+twYXDePcAYdsBZML36FXtdxlsqncs8WJg7Q= X-Received: by 2002:a05:6871:28a:b0:31d:6d47:c63c with SMTP id 586e51a60fabf-32e57e362eemr1412321fac.47.1757682682608; Fri, 12 Sep 2025 06:11:22 -0700 (PDT) MIME-Version: 1.0 References: <77a63548783dd4007ee479a4c5ed300629aaa776.camel@cybertec.at> In-Reply-To: <77a63548783dd4007ee479a4c5ed300629aaa776.camel@cybertec.at> From: Dominique Devienne Date: Fri, 12 Sep 2025 15:11:10 +0200 X-Gm-Features: Ac12FXzQwa0CSVUsWQ3_OAKPi8GMTmnWUHMg8dZllM4PBU68T7ZWrVAVWUya6mM Message-ID: Subject: Re: Latest patches break one of our unit-test, related to RLS To: Laurenz Albe Cc: 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 2:45=E2=80=AFPM Laurenz Albe wrote: > On Fri, 2025-09-12 at 14:22 +0200, Dominique Devienne wrote: > > On Thu, Sep 4, 2025 at 5:03=E2=80=AFPM Dominique Devienne wrote: > > > OK with 16.9 and 17.5 (we cannot test on beta2 anymore) > > > KO with 16.10 and 17.6 (and beta3 too, released at the same time) > > > > I've tracked down the regression to this particular query, FWIW: > > > > select rolname, rolsuper, rolinherit, rolcreaterole, > > rolcreatedb, rolcanlogin, rolreplication, rolbypassrls, > > oid, shobj_description(oid, 'pg_authid') > > from pg_roles > > where rolname SIMILAR TO $1 AND pg_has_role(oid, 'SET') > > order by rolname > > > > In 17.5, returns 3 rows. > > In 17.6, returns 0 rows. > > That must be commit e3ffc3e91d. > > That commit fixed a bug in the conversion from SIMILAR TO > expressions to POSIX regular expressions. > > You don't show us that data that match the pattern in 17.5, but > not in 17.6. Unless you show us a counterexample, I'd say that > the behavior in 17.6 is correct. > > Minor releases shouldn't change the behavior EXCEPT when the > behavior is buggy. Can't get any simpler than the repro below, can it? So is this buggy or not? Clearly, there's a change in behavior. I tend to call a change in behavior as a regression myself :) But if someone can explain to me how what used to work was incorrect, compared to the documented behavior, I'm willing to change it of course. Any takers? --DD postgres=3D# show server_version; server_version ---------------- 16.9 (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 --------- foo0bar (1 row) postgres=3D# \c - - - 5416; psql (17.6, server 16.10) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: none) You are now connected to database "postgres" as user "postgres" on host "sr-pau-db" (address "10.65.53.13") at port "5416". postgres=3D# show server_version; server_version ---------------- 16.10 (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# \c - - - 5475 psql (17.6, server 17.5) You are now connected to database "postgres" as user "postgres" on host "sr-pau-db" (address "10.65.53.13") at port "5475". postgres=3D# show server_version; server_version ---------------- 17.5 (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 --------- foo0bar (1 row) postgres=3D# \c - - - 5417 SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql) You are now connected to database "postgres" as user "postgres" on host "sr-pau-db" (address "10.65.53.13") at port "5417". postgres=3D# show server_version; server_version ---------------- 17.6 (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# \c - - - 5481 psql (17.6, server 18rc1) WARNING: psql major version 17, server major version 18. Some psql features might not work. You are now connected to database "postgres" as user "postgres" on host "sr-pau-db" (address "10.65.53.13") at port "5481". 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#