Re: BUG #18271: Re: Postgres policy exists bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18271: Re: Postgres policy exists bug
Date
Msg-id 946635.1704467657@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18271: Re: Postgres policy exists bug  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> After submitting my initial report, I attempted to find a workaround for the
> issue. However, during this process, I discovered the same behavior as with
> the EXISTS operation, specifically when dealing with subqueries.

Neither here nor in the other thread have you provided a
*self-contained* example of what you think is wrong.  I experimented
with a function like your example here and couldn't see anything that
looked wrong to me.

As far as this bit goes:

> FALSE IN (
>     SELECT is_private
>     FROM public.profiles AS p
>     WHERE p.user_id = user_id
> )

you do realize that "user_id" here will be resolved as p.user_id
because that's the most closely nested source of such a column?
So that WHERE clause will not provide any useful filter.

Your function example doesn't have that bug, but your original
policy definition looks like it might.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18271: Re: Postgres policy exists bug
Next
From: Vojtěch Beneš
Date:
Subject: Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type