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 1u8DBI-00FyV5-G3 for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 07:09:04 +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 1u8DBG-007kwM-18 for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 07:09:02 +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 1u8DBF-007kwE-Jt for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 07:09:02 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8DBD-001vEb-0X for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 07:09:02 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-ac2c7a36802so31835966b.2 for ; Fri, 25 Apr 2025 00:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745564938; x=1746169738; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=xWgUgnk+NnVG6mMUr1miM46Q5xvp6qYI4TzM0FFdbaA=; b=C3R4Rd0U5KLr/VyVx/9Mzrl60bphMgq7RF2iMb5KNRIkOoxG5Y1hnQgJbmvPdwL7OF wYBBx81WVgujl01SxMP/WRnnxCZY5Zc9ZASOrU863Yyor7tHvhBLKQHMV09FCYDw8Yvs 1IwVF9BGp+TmtWIJ9RATQvdN64WA7YeAkCbIizqAHBQ6BcaVoFeg3oZd3+1Ql88MXvUB jOZHNE+7J2UaSCnqnzirv0ltvOq7HXkP+EE2H7x78wWkzW9cRYWSlrcQy82OiLIunCcH A6VhaoYOQFZuV+Rg55VXb/l74PvAG0qHf9vEFGI4rAapUXth1VTNlTgrnj82YWg1HrG0 GLEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745564938; x=1746169738; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xWgUgnk+NnVG6mMUr1miM46Q5xvp6qYI4TzM0FFdbaA=; b=PmZ5DUSew+MLM/b9O8DL0aiBDju8pJ/l3p/OlnjNo1vqkrD6MaurX2dlLkFC1Ikrh5 fdnU5ls+NL+IhdM0amtJeL2KRgj13USUTaxUNYdOOqFSUy4yL4zZUOTC8FfPYZGfi7eO Vhr/OgQr3hnli/vthlTBt4WN6TOzkDqVW+kRaSyB6v1QUw2Ado/sgtVhTVmwEs/HsXA7 Cyyu0c+EtkIWzFmQGS5KfTdxKAhLWkEshxwrmATzglXFtcAYRHCQ9yCn15Qz5IKGRd3k InkyWBnsT57nORuCX2OmZTcyuWvTmgGC3S4ag/4D1z/XN0fYqZDmrvpj6OpiNIPo4T+g jC0g== X-Gm-Message-State: AOJu0YyVsrGugYGwTybIMxKUo8FR2UjoTJrhnwp62Dh/4CeUqb3+oFLG BU+ILWgPJha2xKM8kZodHbG/rSYXd9ABn4ETZ6HC3owJgxkT0WuzxgiHnd0whPn3h3azD5vggKk 9RwYf6EqhttxDPsqZ2jKeLZRKhNgVz+ALtEU= X-Gm-Gg: ASbGncvgZveFS2mhUhdV+eplE9eq+2bNrNJKtHmhwi00xsbsMHKqTyZZYBkR7lhXCxw uz7cA6EyC3pOO35yK4Bju4IpXUNfQ0QILDmU45hd3Zogyrh9iEhTxM6+zWQbOiPXjBoiXCAg5vM EGKYiRL916RHhzDCCOS+1m0w== X-Google-Smtp-Source: AGHT+IGpz3L7Z+ZXNCltlFKQnSiRTGV2a0yoBoUx1pkxpuQh6PfIBTPOrlte+OSvUmZaIpgz2DPZrF2DdC3q8LDx5e4= X-Received: by 2002:a17:907:72cf:b0:acb:b966:3a8c with SMTP id a640c23a62f3a-ace71345689mr39210566b.10.1745564938393; Fri, 25 Apr 2025 00:08:58 -0700 (PDT) MIME-Version: 1.0 From: Vydehi Ganti Date: Fri, 25 Apr 2025 12:38:47 +0530 X-Gm-Features: ATxdqUFk1Vs-XixHn8rDzrwK-Lc2gg0ME-dL27MOL3BqgUp9AzwEyAz5DOpiUIY Message-ID: Subject: Clarification on RLS policy To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000015ddb7063395024a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000015ddb7063395024a Content-Type: text/plain; charset="UTF-8" Hi Team, We are presently using Postgresql:PostgreSQL 15.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-23), 64-bit I have a scenario where 1.I need to enforce RLS policy on a table for Select by calling a Function 2.The function would return a character varying string which should be appended to the select as a filter. Ex: Select * from employee would be appended with where 1=1; 3.When we try to implement it says the below error. ERROR: invalid input syntax for type boolean: "1=1" CONTEXT: PL/pgSQL function function name(name,name) while casting return value to function's return type 4.It works fine on Oracle. Can you please suggest how to fix this issue? Rg Vydehi. --00000000000015ddb7063395024a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

We are presently using Postgre= sql:PostgreSQL 15.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20= 210514 (Red Hat 8.5.0-23), 64-bit
I have a scenario where
1.I need to enforce RLS policy on a table for Select by calling a Functi= on
2.The function would return a character varying string which s= hould be appended to the select as a filter.
Ex: Select * from em= ployee would=C2=A0be appended=C2=A0with where 1=3D1;
3.When we tr= y to implement it says the below error.
ERROR: invalid input syntax for type boolean: "1= =3D1" CONTEXT: PL/pgSQL function function name(name,name) while casting return v= alue to function's return type
4.It= works fine on Oracle. Can you please suggest how to fix this issue?

Rg
Vydehi.
--00000000000015ddb7063395024a--