Views no longer in rangeTabls?

From: David Steele <david(at)pgmasters(dot)net>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Amit Langote <amitlangote09(at)gmail(dot)com>
Subject: Views no longer in rangeTabls?
Date: 2023-06-09 08:28:48
Message-ID: 3953179e-9540-e5d1-a743-4bef368785b0@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

While updating pgAudit for PG16 I found the following (from our
perspective) regression.

In prior versions of Postgres, views were listed in rangeTabls when
ExecutorCheckPerms_hook() was called but in PG16 the views are no longer
in this list. The permissions have been broken out into permInfos as of
a61b1f748 and this list does include the view.

It seems the thing to do here would be to scan permInfos instead, which
works fine except that we also need access to rellockmode, which is only
included in rangeTabls. We can add a scan of rangeTabls to get
rellockmode when needed and we might be better off overall since
permInfos will generally have fewer entries. I have not implemented this
yet but it seems like it will work.

From reading the discussion it appears this change to rangeTabls was
intentional, but I wonder if I am missing something. For instance, is
there a better way to get rellockmode when scanning permInfos?

It seems unlikely that we are the only ones using rangeTabls in an
extension, so others might benefit from having an answer to this on list.

Thanks,
-David

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2023-06-09 08:57:02 Re: Remove WindowClause PARTITION BY items belonging to redundant pathkeys
Previous Message Gurjeet Singh 2023-06-09 08:05:43 Re: Major pgbench synthetic SELECT workload regression, Ubuntu 23.04+PG15