Re: generating function default settings from pg_proc.dat
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Corey Huinker <corey.huinker@gmail.com>,
Andres Freund <andres@anarazel.de>,
Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-02-21T15:29:36Z
Lists: pgsql-hackers
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes: > I tested this patch here and it seems to behave as intended. Thanks for looking! > The deal with system_views.sql is not clear to me. Previously, the > function underlying each view was in pg_proc.dat and the ACL was tweaked > in system_views.sql together with the place where the function was used > to define the view; now it seems the whole of the function (incl its > ACL) is in pg_proc.dat, and only the view itself is in system_views.sql. Yeah, as I mentioned upthread, I'm not totally pleased with that. It seemed to make sense to adjust the permissions of the views and their underlying functions together. This patch loses that, but keeps consistency with other built-in functions and promotes "single source of truth". Is that a good tradeoff? I'm not sure. I think there's a case to be made for continuing to handle these specific functions' ACLs as we do now. > I think this is an OK arrangement, but perhaps there should be a comment > in system_views.sql about it. Yeah, that'd be a good thing to do if we keep it like this. Perhaps more or less * Some of these views are not meant to be publicly readable. The * underlying function(s) for such a view should not be publicly * executable either --- but by default they will be. Don't forget to * adjust function permissions (in pg_proc.dat) when adding a new view. regards, tom lane
Commits
-
Simplify creation of built-in functions with non-default ACLs.
- f95d73ed4332 19 (unreleased) landed
-
Be more wary of false matches in initdb's replace_token().
- 7664319ccb02 19 (unreleased) landed
-
Simplify creation of built-in functions with default arguments.
- 759b03b24ce9 19 (unreleased) landed