Re: Mark all GUC variable as PGDLLIMPORT
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <bruce@momjian.us>, Julien Rouhaud <rjuju123@gmail.com>, Michael Paquier <michael@paquier.xyz>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-23T15:40:20Z
Lists: pgsql-hackers
On 2021-Aug-23, Robert Haas wrote: > It's also a bit unfair to say, well we have APIs for accessing GUC > values. It's true that we do. But if the GUC variable is, say, a > Boolean, you do not want your extension to call some function that > does a bunch of shenanigans and returns a string so that you can then > turn around and parse the string to recover the Boolean value. Even > moreso if the value is an integer or a comma-separated list. You want > to access the value as the system represents it internally, not > duplicate the parsing logic in a way that is inefficient and > bug-prone. In that case, why not improve the API with functions that return the values in some native datatype? For scalars with native C types (int, floats, Boolean etc) this is easy enough; I bet it'll solve 99% of the problems or more. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
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