Re: RLS creates inaccurate limit and offset results

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: mike(at)mikebrancato(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: RLS creates inaccurate limit and offset results
Date: 2025-11-11 22:10:23
Message-ID: E02822A7-6755-476C-AE78-5DDBE69304C4@thebuild.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On Nov 11, 2025, at 08:29, mike(at)mikebrancato(dot)com wrote:
> I have noticed that using row level security can cause use of `LIMIT` and `OFFSET` to return inconsistent results without the use of an explicit `ORDER BY`.

LIMIT and OFFSET without ORDER BY are not guaranteed to return consistent results even without RLS. RLS may cause it be more obvious, however.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message mike 2025-11-11 22:46:28 Re: RLS creates inaccurate limit and offset results
Previous Message Tom Lane 2025-11-11 20:27:59 Re: BUG #19106: Potential regression with CTE materialization planning in Postgres 18