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 1u8IzI-000dmJ-RO for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 13:21:05 +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 1u8IzH-00Aw8p-4E for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 13:21:03 +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 1u8IzG-00Aw8h-PC for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 13:21:03 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8IzE-0020bE-1T for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 13:21:03 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-acb78975cb9so33687366b.3 for ; Fri, 25 Apr 2025 06:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745587260; x=1746192060; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ErzGWgKiUdSyLAn52aXMlG0/727J28luGb0V+E4fhpQ=; b=RMpIlpLrmcFSJpYBYjgNr8twvuHAlASHaS1PZ+rgEjc0k7VhtzWeSzaIz8yzBOz0v8 AC4STB8JNxl54cewK8XWCxgbNOPAysm4uJQfwVPPfP4DBddWsyky8dajRa0dB5lZnrEp jNsadLFxYRlLtfKNcvTH1bQ2Jpa2934sy0YDluu1FUt/hG5fPRtYIXfS7zf0Gb6ZRdqq 2AVuuugJBJQcf1y+7oGrKvFpaklBrBDSe+h3ceKOP7ZCMSjYsYcbkr/WBK9Tfr07czSu t/wpHOdVL4nNpyRY30CPSKUF9Tc/TrQEvdQ+IOD8IwzDMTRqnYjZzUZhLmaQb8Qpfm/J eejA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745587260; x=1746192060; h=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=ErzGWgKiUdSyLAn52aXMlG0/727J28luGb0V+E4fhpQ=; b=Vp4WExsCCOXk7O/Jj7RHs4kDSTa6SnnxqjIeTKTs7r4VWWZZAIvZY3CjePuQN0GjMe 1wdYwhmpyYDJ6bX7ydEZ/6BQ0zyVk5C437ugn5SpsFSkmMJ47kdt276RfYhSEiK9K3UQ /N304cnLQE7211YCUicGCsG/Dz3o/AqgKLIDAORo66CM7URP8ztgDWB095fTZiujagK0 3yyLzoIIAREvBih1oaKz/exDMdlbkN2VZSQ62xNJVSgpYO1WuHC0P4PhYpfFEtprgoNo /lKFpHk2Pv4IbNfDGQn3WkRb/cC39iT2qCU0I9BIxSWd2pa48ux73fG9j84mELaLWut/ PW1Q== X-Forwarded-Encrypted: i=1; AJvYcCUZvewwlSCc9YM1Lisu67ReQ+JgQJxVr3nYzL1F516BrzkF+LWFYOFr36zqJrNIiqcrzUcL7hV0mKoh8iS1@lists.postgresql.org X-Gm-Message-State: AOJu0YyM8b0HMOOFVDDAfg5eY8jfD8fGTVvaAV617v8ttsrAPlrWN638 OXR4SsbaKwV8b75cOcfEbCwZ1jCRnoLWwmrbwGkpniuYtrJ7MONveBdDgoaLkuW7W36myxBHlgV XuJF01zuNyWk/mpt5Xp7A5u6z7fY= X-Gm-Gg: ASbGnctpvhcDNbpd5LwdIs29rlQaEkREm4+g6sH6cyuMChco07xgtJUJyfSelq+MtmJ fUk/H74bWml9Qge2+UAiPSXoXp1KERg75zjy4G/kUYM4P/IlqNHc+dtDb4TlDBAmPAi8jU2m7/F LYmUqbOJY7KfPqz9UPcG2o1Q== X-Google-Smtp-Source: AGHT+IHXM8KiA2ybAxa5/TY0ONhWQBogqYbxbjltOVjxU/VBCsSCGKeyj9AuJPmQhSK2wEX4vVrdfFvqvbjEiDgV8Mw= X-Received: by 2002:a17:907:72cf:b0:acb:b966:3a8c with SMTP id a640c23a62f3a-ace71345689mr82060166b.10.1745587260121; Fri, 25 Apr 2025 06:21:00 -0700 (PDT) MIME-Version: 1.0 References: <88804c921b425d37a3072b5698b558a763d80d63.camel@cybertec.at> In-Reply-To: From: Vydehi Ganti Date: Fri, 25 Apr 2025 18:50:46 +0530 X-Gm-Features: ATxdqUFOoeFTHhBi8XYvW08Amgc5V7PJ-WhJOr7u13jb2fkmPGkaWHSKC_Vipg8 Message-ID: Subject: Re: Clarification on RLS policy To: Dominique Devienne Cc: Laurenz Albe , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000009067c006339a34d0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009067c006339a34d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable So I don't have a possibility to append where clause dynamically and can only check the boolean? On Fri, 25 Apr, 2025, 18:48 Dominique Devienne, wrote= : > On Fri, Apr 25, 2025 at 3:01=E2=80=AFPM Vydehi Ganti = wrote: > > Then it should build up the lPredicate with the filter condition and > append to the query user runs on the Activity table. > > You're not reading us, and asking us to do the work for you... > RLS Predicates don't return strings in PostgreSQL, but a boolean. > Write your function to do your check, and return TRUE or FALSE. > --0000000000009067c006339a34d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

So I don't have a possibility to append where clause dyn= amically and can only check the boolean?


On Fri, 25 Apr, 2025, 18:48 Dominique Devienne, <ddevienne@gmail.com> wrote:
On Fri, Apr 25, 2025 at 3:01=E2=80=AFPM Vyd= ehi Ganti <rayudugs@gmail.com> wrote:
> Then it should build up the lPredicate with the filter condition and a= ppend to the query user runs on the Activity table.

You're not reading us, and asking us to do the work for you...
RLS Predicates don't return strings in PostgreSQL, but a boolean.
Write your function to do your check, and return TRUE or FALSE.
--0000000000009067c006339a34d0--