policies with security definer option for allowing inline optimization

From: Dan Lynch <pyramation(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: policies with security definer option for allowing inline optimization
Date: 2021-04-02 05:44:02
Message-ID: CA+_muLEWeghudnvHMJhhyDpzLTZEGFfvGhBeTxFMk0vT2x+-9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

RLS policies quals/checks are optimized inline, and so I generally avoid
writing a separate procedure so the optimizer can do it's thing.

However, if you need a security definer to avoid recursive RLS if you're
doing a more complex query say, on a join table, anyone wish there was a
flag on the policy itself to specify that `WITH CHECK` or `USING`
expression could be run via security definer?

The main reason for this is to avoid writing a separate security definer
function so you can benefit from the optimizer.

Is this possible? Would this be worth a feature request to postgres core?

Cheers!

Dan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-04-02 05:45:06 Re: libpq debug log
Previous Message Fabien COELHO 2021-04-02 05:43:55 Re: pgbench - add pseudo-random permutation function