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 1u8J78-000gQZ-Pq for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 13:29:11 +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 1u8J76-00B7TA-Oj for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 13:29:09 +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 1u8J76-00B7T2-DQ for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 13:29:09 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8J75-001tZf-0a for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 13:29:08 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-ac3beea7762so33635166b.2 for ; Fri, 25 Apr 2025 06:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745587746; x=1746192546; 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=xYeBv6TDUAgUuvpaoRU9f+QHTCzsxlxjKnqsKLOUEmM=; b=C2iDDLnb9NYBwNvY4TyFDnLYtLLocQFDKm8gdwWjoNeI/T4VFu8/DexTIuZpyxSUDS fPTS+Pqq2IepftugEZzoFTMefg3mDVFTDU1rGoZFtP+D0ezWM9Ule6fZFxp0MrNv23tv MNwpmZL1HXzcDYMh13Lk3XBGMlyzxjDkVKumQY2cc2LMWKBiRdTqmcGVoHg7MG8e6yFt x6Vd82TV5nMbK8gCjExR0bZqCd9T1DlscdF77NRn+qjp/VHwZoTTSIePzo6FZBrMVtTR e1CurijTrqOP5G9nY9+lPpANFj1U2bdbAKRZZDamRTJh+AiDpOrVtdS3RVNvoTZzrtly bcYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745587746; x=1746192546; 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=xYeBv6TDUAgUuvpaoRU9f+QHTCzsxlxjKnqsKLOUEmM=; b=cKR8pqZC6HfZY9NY8gH4xdDzJ2p5GSFEi2ENTNyKbCyGF92vkUBOk3Kxy49QPIIQyb kBliNBg7Vo+NejcmmF+KkcXpTjhttqMVItX3QTYjpkCBrcPrJBaR23DUtrjfrQmn/uZL V2SxVYwIrKwD+lTpfKsgvxYzC8xEiK0cxOV7Y9Y36v1FwrMRNv8A8SSIpd0m1w3eYDRu h4QzW9vhQMSONrC/+Fh+w25nKxWZX3MurVRzk3y3uWGMLK0QI9FvrDr6n6PMu0FHGnFQ 5V4lWhN7CHTNJrhnGwhEuZm9aJGVmH88cH2wTglhbJYg16J87iUuFR8f8fLg82R5r31p f4cQ== X-Forwarded-Encrypted: i=1; AJvYcCU5nqc5HgQHZ9qaanebFfF+AGdIiQnihzyfgb9PIllG1knghfuZmadaQsYlW/YBTR7WIlclJ/wzUjOJeFo5@lists.postgresql.org X-Gm-Message-State: AOJu0YyO87ELR8JQ/Z5e6mU0Mhz2a9TOUvkxLTnEYoCwcTWkvbPpQxYD Lcafp1CEJ1WJ3eMAvmKJwXKeSXLmXlLuy6APXsjl3RHqTgVYBzS6iPSPpiVD03t6k1+7ott9a+L 46ppMJjm5Z1EjilI0tcT0O1wCvsYkBn7+ X-Gm-Gg: ASbGnctpo4a+tJ/MnhT/j9AhVp/lnP/9RtF9sNIhjUOHiDV+ISK+DB+lCfwY7H3RhHk wXruMswQjNulFmlG/h8c/KHbX0A0ZwmdQLjG2vk5pqTwKImJvUXsHA5GWgfRexwv+1F8xV3x05g WtiNc/9cENw/hYhoA4zdeBBw== X-Google-Smtp-Source: AGHT+IHj1+Z2823kvCiwPEQi0lF4NBlUaMvcTdRYaAuFt3tsPsGpDDxSdCFCs1yMN0IY3ufvka9XAbl+NklSnt7go88= X-Received: by 2002:a17:907:948a:b0:abb:eec3:3937 with SMTP id a640c23a62f3a-ace713508e7mr80400466b.10.1745587746012; Fri, 25 Apr 2025 06:29:06 -0700 (PDT) MIME-Version: 1.0 References: <88804c921b425d37a3072b5698b558a763d80d63.camel@cybertec.at> In-Reply-To: From: Vydehi Ganti Date: Fri, 25 Apr 2025 18:58:52 +0530 X-Gm-Features: ATxdqUGGkIl_sE2eLR1WYcKDcsnmTWFhqPqOh4Pr5K-vE6vLwFUYwIMDfBwoClo Message-ID: Subject: Re: Clarification on RLS policy To: Dominique Devienne Cc: Laurenz Albe , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000086843006339a5143" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000086843006339a5143 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Can i know if there is any scenario or ref document for the design you suggested above? On Fri, 25 Apr, 2025, 18:56 Dominique Devienne, wrote= : > On Fri, Apr 25, 2025 at 3:21=E2=80=AFPM Vydehi Ganti = wrote: > > So I don't have a possibility to append where clause dynamically and ca= n > only check the boolean? > > Indeed. But given that you can run arbitrary SQL inside the function, > even dynamic SQL, > that ends up pretty much the same. And you have access to in-row > values too, when calling the function. > It's just a different design, that's all. --DD > --00000000000086843006339a5143 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Can i know if there is any scenario or ref document for the = design you suggested above?


On Fri, 25 Apr, 2025, 18:56 Dominique Devienne, <ddevienne@gmail.com> wrote:
On Fri, Apr 25, 2025 at 3:21=E2=80=AFPM Vyd= ehi Ganti <rayudugs@gmail.com> wrote:
> So I don't have a possibility to append where clause dynamically a= nd can only check the boolean?

Indeed. But given that you can run arbitrary SQL inside the function,
even dynamic SQL,
that ends up pretty much the same. And you have access to in-row
values too, when calling the function.
It's just a different design, that's all. --DD
--00000000000086843006339a5143--