Subject: Record last SELECT on a row?

From: Thiemo Kellner <[email-masked]>
Date: Wed, 17 Dec 2025 18:14:33 +0100 (GMT+01:00)

Hi

I wonder whether a view calling a set returning function would be a viable option. Within the function you execute the actual query twice. Once to merge selected pk into a protocol table and once for the return of the data set.

Cheers

Thiemo

---

From: Greg Sabino Mullane <[email-masked]>
Date: Wed, 17 Dec 2025 12:23:31 -0500

On Wed, Dec 17, 2025 at 12:14 PM Thiemo Kellner <[email-masked]>
wrote:

> I wonder whether a view calling a set returning function would be a viable
> option. Within the function you execute the actual query twice. Once to
> merge selected pk into a protocol table and once for the return of the data
> set.
>

The view would be sucking in the entire table every time . Maybe not a big
deal as this is a very tiny table.

I think Joe wins this thread with the RLS idea however.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support