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 1ux2p2-00A9U2-82 for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 12:24:12 +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 1ux2o1-000jfY-Rt for pgsql-general@arkaria.postgresql.org; Fri, 12 Sep 2025 12:23:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ux2o1-000jfQ-Gu for pgsql-general@lists.postgresql.org; Fri, 12 Sep 2025 12:23:10 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ux2ny-000NPc-2M for pgsql-general@postgresql.org; Fri, 12 Sep 2025 12:23:10 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-30cce892b7dso878997fac.1 for ; Fri, 12 Sep 2025 05:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757679786; x=1758284586; darn=postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o/P17za8Jt5wP9kW6UXBh+SvWlbi4rQYcmkYLXNYPS4=; b=RCxzuUjhiIvqCcm5Vyzk4ZnbkhMCHBpXyyfWpZJuksHFLWzWE0Ln/D/0Xb7GzFu9Bj MfKKH9/4NDlkmaF0MztrY2YyF2emmc12q0EHJ0M98avKFWbUAeIXIY/O1NsN3w0eMbsV oQa0p7p1idcAegjnGLh9rl2jaTXGTYVhcFUwdrfPTKgEK6mY7frHP0PCO2LI8UhLsYE7 dqlm8kNh0Xc9EzrEIwczD1/skKQbrNPQupNCRxPGDr4/BP21wvqESEKQjpf8SExrgsi7 Pjvye9p891zA62r5sl2nd0ChnFqk4MkadDpqcFqL3bGjMWy0QHienBMjXjb6aOtav8wv GN/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757679786; x=1758284586; h=content-transfer-encoding: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=o/P17za8Jt5wP9kW6UXBh+SvWlbi4rQYcmkYLXNYPS4=; b=eeslQdfhKNUOQQUdQnCdjPYlcnCqH6llHlV6dkSC38yVlz3Fv/o9RTcfuNJThO6SNl O0wzPlEs56FYme6vI/Ac8ggZy8cKa2n2ny7Eve5h6Zf1A5A9u5fHT7oVtmY2pR15Glq3 wMX3zwzPUf3JLkIxHlC1lXRuh7lVPieDOOJVIC73sIalgTbn7um/STHy9o9s2TcBXeqf 0LB+Dasd1aUj72ZNdwdDvUEwptRyYW7RNTehK+RgU64LMUzjMXkTWNMMdmKiFWGf6dKn XLMlyp9DcX4uhW9M/Thk9Iog9++fkD6rf9GNY6iiGJ920ow4CCJqT8ciu4I4Pi2toNR0 ZHvw== X-Gm-Message-State: AOJu0YzFGdZkReYsXMvJPA8bDc1FrrrWsGP/18W/nRZM6cBNnBnlOa5i mAMdYM6DXMMY2SApl8ia48SaHbHR1sYgjUmETQkzbtHpVE+7KP42/kbWxx6XSMJlafrWog9A2q8 fZj+y0fZubSBRuuaGYlWJ31yhAtckZZnRppMC X-Gm-Gg: ASbGncvrz+hzeU7rkFsK15+TetUzMmUs7aLh9DZw2HBowhXxr/H+i1tkoZ92IMVqSPn z9EqJE0fj0gPO8Dl9FueGvo59C79HDOzQLBoOfCbmo7PohAYUpQ18U4zjEEz6lqb03tk6qRp9KY QSGCOD7meKxt2d/3Pyf3yFrhgzOma2MT6Ozutt2Z5r6z9mT9nzlqctM3cmS2jPRtxyUfvHi1T0z SHELcAMQQ== X-Google-Smtp-Source: AGHT+IHeXUIBhHC3emRlKNrO/PDlKfQNLGhXeCOlXAV8cB5VFOYr2JtMqAc8cLUCd7Ax4hsRdkzPMBV5aUiKWsvKNEA= X-Received: by 2002:a05:6870:89a9:b0:2e8:f5d6:2247 with SMTP id 586e51a60fabf-32e55ec4be7mr1207063fac.32.1757679786405; Fri, 12 Sep 2025 05:23:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dominique Devienne Date: Fri, 12 Sep 2025 14:22:54 +0200 X-Gm-Features: Ac12FXwXRHRz5kq8eELEW8sTjfJ6lrdpiY_07t7LmxLS9p5VZbt7I2EUdwwUQuM Message-ID: Subject: Re: Latest patches break one of our unit-test, related to RLS To: 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 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. I've used a libpq trace on both, diff'd them, and it's the 1st significant difference. Given my troubles with roles, I immediately imagined a change in pg_has_rol= e(). But turns out, it's SIMILAR TO that changed. See trace extract below for both versions. On 17.6 On the two queries below, the first is the real one, (modulo some mild renaming, to Acme and FOO) and the second is one where I replaced the [\d\w] with a _ The correct answer for the 1st should be (7 rows). This particular char I test on, can be / and : but I want to avoid those entries, thus [\d\w] So, it this a regression? A bug fix, and my pattern is somehow wrong? If it's not a bug/regression, what do you suggest we use instead? If it is a bug, any chance it might be in the upcoming v18 release (and associated earlier version patches???) I think I've found the smoking gun. Haven't verified whether our troubles with v18 pre-releases is related. Thanks, --DD PS: From those 7 rows, pg_has_role() is supposed to narrow it down to 3. acme=3D> select rolname from pg_roles where rolname similar to 'Acme-FOO:8n8igcOH[\d\w]_____________:%' order by 1; rolname --------- (0 rows) acme=3D> select rolname from pg_roles where rolname similar to 'Acme-FOO:8n8igcOH______________:%' order by 1; rolname ------------------------------------------- ... (14 rows) And the same as above, on 17.5: acme=3D> select rolname from pg_roles where rolname similar to 'Acme-FOO:8vjqDaeT[\d\w]_____________:%' order by 1; rolname ---------------------------------------- ... (7 rows) acme=3D> select rolname from pg_roles where rolname similar to 'Acme-FOO:8vjqDaeT______________:%' order by 1; rolname ------------------------------------------- ... (14 rows) --------------- llibpq traces ------------------- 17.5 2025-09-12 13:50:32.267733 B 5 ReadyForQuery I 2025-09-12 13:50:32.267772 F 270 Parse "" " 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 " 1 25 2025-09-12 13:50:32.267775 F 58 Bind "" "" 1 1 1 38 'Acme-FOO:8vjqDaeT[\d\w]_____________:%' 1 1 2025-09-12 13:50:32.267777 F 6 Describe P "" 2025-09-12 13:50:32.267779 F 9 Execute "" 0 2025-09-12 13:50:32.267780 F 4 Sync 2025-09-12 13:50:32.271148 B 4 ParseComplete 2025-09-12 13:50:32.271161 B 4 BindComplete 2025-09-12 13:50:32.271165 B 302 RowDescription 10 "rolname" 12000 1 19 64 -1 1 "rolsuper" 12000 2 16 1 -1 1 "rolinherit" 12000 3 16 1 -1 1 "rolcreaterole" 12000 4 16 1 -1 1 "rolcreatedb" 12000 5 16 1 -1 1 "rolcanlogin" 12000 6 16 1 -1 1 "rolreplication" 12000 7 16 1 -1 1 "rolbypassrls" 12000 11 16 1 -1 1 "oid" 12000 13 26 4 -1 1 "shobj_description" 0 0 25 65535 -1 1 ... 2025-09-12 13:50:32.271200 B 13 CommandComplete "SELECT 3" in 17.6 2025-09-12 13:50:52.512043 B 5 ReadyForQuery I 2025-09-12 13:50:52.512082 F 270 Parse "" " 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 " 1 25 2025-09-12 13:50:52.512085 F 58 Bind "" "" 1 1 1 38 'Acme-FOO:8n8igcOH[\d\w]_____________:%' 1 1 2025-09-12 13:50:52.512088 F 6 Describe P "" 2025-09-12 13:50:52.512089 F 9 Execute "" 0 2025-09-12 13:50:52.512091 F 4 Sync 2025-09-12 13:50:52.540088 B 4 ParseComplete 2025-09-12 13:50:52.540104 B 4 BindComplete 2025-09-12 13:50:52.540109 B 302 RowDescription 10 "rolname" 12000 1 19 64 -1 1 "rolsuper" 12000 2 16 1 -1 1 "rolinherit" 12000 3 16 1 -1 1 "rolcreaterole" 12000 4 16 1 -1 1 "rolcreatedb" 12000 5 16 1 -1 1 "rolcanlogin" 12000 6 16 1 -1 1 "rolreplication" 12000 7 16 1 -1 1 "rolbypassrls" 12000 11 16 1 -1 1 "oid" 12000 13 26 4 -1 1 "shobj_description" 0 0 25 65535 -1 1 2025-09-12 13:50:52.540119 B 13 CommandComplete "SELECT 0"