public inbox for [email protected]  
help / color / mirror / Atom feed
Clarification on RLS policy
2+ messages / 2 participants
[nested] [flat]

* Clarification on RLS policy
@ 2025-04-25 07:08 Vydehi Ganti <[email protected]>
  2025-04-25 08:35 ` Re: Clarification on RLS policy Achilleas Mantzios - cloud <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Vydehi Ganti @ 2025-04-25 07:08 UTC (permalink / raw)
  To: [email protected]

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.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Clarification on RLS policy
  2025-04-25 07:08 Clarification on RLS policy Vydehi Ganti <[email protected]>
@ 2025-04-25 08:35 ` Achilleas Mantzios - cloud <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Achilleas Mantzios - cloud @ 2025-04-25 08:35 UTC (permalink / raw)
  To: [email protected]


On 4/25/25 08:08, Vydehi Ganti wrote:
> 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?

Just show the output of

\d <your_table>

and particularly the Policies: section. Then also show the source of 
your function and anything else involved.

>
> Rg
> Vydehi.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-04-25 08:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-25 07:08 Clarification on RLS policy Vydehi Ganti <[email protected]>
2025-04-25 08:35 ` Achilleas Mantzios - cloud <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox