Re: Mark all GUC variable as PGDLLIMPORT
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Julien Rouhaud <rjuju123@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
pgsql-hackers@lists.postgresql.org
Date: 2021-08-23T14:15:04Z
Lists: pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes: > On Sun, Aug 22, 2021 at 09:29:01PM +0800, Julien Rouhaud wrote: >> Then shouldn't we try to prevent direct access on all platforms rather than >> only one? > Agreed. If Julian says 99% of the non-export problems are GUCs, and we > can just export them all, why not do it? We already export every global > variable on Unix-like systems, and we have seen no downsides. By that argument, *every* globally-visible variable should be marked PGDLLIMPORT. But the mere fact that two backend .c files need to access some variable doesn't mean that we want any random bit of code doing so. And yes, I absolutely would prohibit extensions from accessing many of them, if there were a reasonable way to do it. It would be a good start towards establishing a defined API for extensions. regards, tom lane
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