Re: Mark all GUC variable as PGDLLIMPORT
Chapman Flack <chap@anastigmatix.net>
From: Chapman Flack <chap@anastigmatix.net>
To: Robert Haas <robertmhaas@gmail.com>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>, Bruce Momjian <bruce@momjian.us>,
Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-24T18:52:23Z
Lists: pgsql-hackers
On 08/24/21 14:28, Robert Haas wrote: > cost would, I think, be quite terrible. If you really had to force > everything through an API, I think what you'd want to do is define an > API where code can look up a handle object for a GUC using the name of > the GUC, and then hold onto a pointer to the handle and use that for > future accesses, so that you don't have to keep incurring the expense > of a hash table hit on every access. But even if you did that, > preventing "unauthorized" writes to GUC variables would require a > function call for every access. I don't think that's true of the second proposal in [0]. I don't foresee a noticeable runtime cost unless there is a plausible workload that involves very frequent updates to GUC settings that are also of interest to a bunch of extensions. Maybe I'll take a stab at a POC. Regards, -Chap [0] https://www.postgresql.org/message-id/6123C425.3080409%40anastigmatix.net
Commits
-
Remove PGDLLIMPORT marker from __pg_log_level
- 8d3341266508 15.0 landed
-
Mark a few 'bbsink' related functions / variables static.
- b5f44225b833 15.0 landed
-
Add some missing PGDLLIMPORT markings
- 5edeb574285e 15.0 landed
-
Apply PGDLLIMPORT markings broadly.
- 8ec569479fc2 15.0 landed
-
Helper script to apply PGDLLIMPORT markings.
- 80900d469091 15.0 landed
-
Simplify declaring variables exported from libpgcommon and libpgport.
- e04a8059a74c 15.0 cited