Postgresql 中文操作指南
20.16. Customized Options #
此功能旨在允许通过附加模块(例如过程语言)添加 PostgreSQL 通常不知道的参数。这允许以标准方式配置扩展模块。
This feature was designed to allow parameters not normally known to PostgreSQL to be added by add-on modules (such as procedural languages). This allows extension modules to be configured in the standard ways.
自定义选项具有两部分名称:扩展名,然后是一个点,然后是参数名本身,非常类似于 SQL 中的限定名。一个示例是 plpgsql.variable_conflict。
Custom options have two-part names: an extension name, then a dot, then the parameter name proper, much like qualified names in SQL. An example is plpgsql.variable_conflict.
由于自定义选项可能需要在未加载相关扩展模块的进程中设置,因此 PostgreSQL 会接受任何两部分参数名称的设置。此类变量被视为占位符,并且在定义它们的模块加载之前不起作用。当加载扩展模块时,它会添加其变量定义,并根据这些定义转换任何占位符值。如果存在以其扩展名开头的任何未识别的占位符,则会发出警告并删除这些占位符。
Because custom options may need to be set in processes that have not loaded the relevant extension module, PostgreSQL will accept a setting for any two-part parameter name. Such variables are treated as placeholders and have no function until the module that defines them is loaded. When an extension module is loaded, it will add its variable definitions and convert any placeholder values according to those definitions. If there are any unrecognized placeholders that begin with its extension name, warnings are issued and those placeholders are removed.