Postgresql 中文操作指南
Description
此命令将一个共享库文件加载到 PostgreSQL 服务器的地址空间。如果文件已经加载,则此命令将不起作用。只要调用其一个函数,就会自动加载包含 C 函数的共享库文件。因此,明确的 LOAD 通常仅用于加载一个库来通过“hook”而不是提供一组函数来修改服务器的行为。
This command loads a shared library file into the PostgreSQL server’s address space. If the file has been loaded already, the command does nothing. Shared library files that contain C functions are automatically loaded whenever one of their functions is called. Therefore, an explicit LOAD is usually only needed to load a library that modifies the server’s behavior through “hooks” rather than providing a set of functions.
库文件名通常仅作为基本的文件名给出,在服务器的库搜索路径(由 dynamic_library_path 设置)中搜索该文件名。或者,它可以作为完整路径名给出。在这两种情况下,都可以省略平台的标准共享库文件扩展名。有关此主题的更多信息,请参见 Section 38.10.1 。
The library file name is typically given as just a bare file name, which is sought in the server’s library search path (set by dynamic_library_path). Alternatively it can be given as a full path name. In either case the platform’s standard shared library file name extension may be omitted. See Section 38.10.1 for more information on this topic.
非超级用户只能对位于 $libdir/plugins/ 中的库文件应用 LOAD — 指定的 filename 必须完全以此字符串开头。(数据库管理员有责任确保在此处仅安装“安全”库。)
Non-superusers can only apply LOAD to library files located in $libdir/plugins/ — the specified filename must begin with exactly that string. (It is the database administrator’s responsibility to ensure that only “safe” libraries are installed there.)