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/