Re: Virtual generated columns

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Virtual generated columns
Date: 2024-11-07 09:35:42
Message-ID: CAEZATCUHnmOu7RtDuP+PCtS_dqvU8hFsAYYFPdiB8gyFszj5WQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 5 Nov 2024 at 16:17, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> New patch version.

What happened with the RLS support? It looks like you moved the code
to expand virtual generated columns back to the first loop in
fireRIRrules(), which doesn't work because RLS policies might contain
references to virtual generated columns.

In the v7 patch, it was done in a separate loop, after the RLS policy
loop, which I thought was fine, except that I didn't like having a
whole new loop, opening and closing all the relations in the query.
Was there some other problem with that approach?

What I originally had in mind was doing it at the end of the RLS
policy loop, rather than adding another loop, as in the attached delta
patch. This passes all the current tests, and appears to work fine in
the new tests with RLS policies referring to virtual generated
columns.

Regards,
Dean

Attachment Content-Type Size
rls-fix.patch.no-cfbot application/octet-stream 4.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-11-07 09:50:04 Re: Pgoutput not capturing the generated columns
Previous Message Daniel Gustafsson 2024-11-07 09:25:47 Re: Adding NetBSD and OpenBSD to Postgres CI