{"Entry":{"collection":"guc","key":"dynamic_library_path","name":"dynamic_library_path","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Other Defaults","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.3","status":"changed","to":"8.4"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"14","status":"changed","to":"15"}],"content_hash":"d25c167e07d0c60236554381fd13d31d9f076a57bb67d3dd59126a96194c1b13","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"$libdir"}],"derived_content_hash":"2c9cd6e470865deb7c38fc035259510779e9c50cdba5daf1205ee25633081240","editorial":{"advice":{"olap":"Add a search directory only for a reviewed analytical extension package present identically on every failover target.","oltp":"Keep dynamic_library_path restricted to administrator-controlled, version-matched directories and retain $libdir. Use absolute module paths only when deployment and rollback manage them explicitly.","small":"Keep $libdir. Expanding the native-code search path provides no capacity gain and increases packaging and trust risk."},"mechanism":["dynamic_library_path sets the path for dynamically loadable modules. If a dynamically loadable module needs to be opened and the specified name does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the specified file. The search is used only for module names without a directory component; $libdir points at PostgreSQL's version-specific library directory.","dynamic_library_path is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.","Library discovery and preloading interact with installed binary versions, extension control files, server or backend startup, and the module's own GUCs."],"pitfalls":["Changing dynamic_library_path in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.","Naming a missing or ABI-incompatible module and causing connection failure or a server that cannot start.","Treating a search or preload path as harmless even though it defines which native code the server trusts.","Changing dynamic_library_path globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: dynamic_library_path","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-DYNAMIC-LIBRARY-PATH"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["shared_preload_libraries","session_preload_libraries","local_preload_libraries","jit_provider","extension_control_path"],"summary":"dynamic_library_path is the PostgreSQL setting that defines the path for dynamically loadable modules."},"enumvals":[],"first_version":"7.4","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:31.140084+08:00","intro_commit":{},"key":"dynamic_library_path","last_version":"20","max_val":"","min_val":"","name":"dynamic_library_path","position":107,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:3f3f1c70e4c752bb13eea622f15218f1c2ce59b6151fef067d2d4324a7e7e036","receipt_sha256":"b24b22a0c4ff22d8d3872ea5e952c1c04a3a64b524ab082ee7748107782dd710","repair":"wiki-repair-20261023"},"short_desc":"If a dynamically loadable module needs to be opened and the file name specified in the CREATE FUNCTION or LOAD command does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the required file.","short_desc_zh":"","source_rev":"wiki-repair-20261023:48d72d55fdd4e2721dac153c7f90b91377429f0830be5c8810fbcd3a354a17c1","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"dynamic_library_path","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"dynamic_library_path","SourceRevision":"wiki-repair-20261023:48d72d55fdd4e2721dac153c7f90b91377429f0830be5c8810fbcd3a354a17c1","Facts":{"boot_val":"$libdir","category":"Client Connection Defaults / Other Defaults","context":"superuser","description":"If a dynamically loadable module needs to be opened and the file name specified in the CREATE FUNCTION or LOAD command does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the required file. The value for dynamic_library_path must be a list of absolute directory paths separated by colons (or semi-colons on Windows). If a list element starts with the special string $libdir, the compiled-in PostgreSQL package library directory is substituted for $libdir; this is where the modules provided by the standard PostgreSQL distribution are installed. (Use pg_config --pkglibdir to find out the name of this directory.) For example: dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' or, in a Windows environment: dynamic_library_path = 'C:\\tools\\postgresql;H:\\my_project\\lib;$libdir' The default value for this parameter is '$libdir'. If the value is set to an empty string, the automatic path search is turned off. This parameter can be changed at run time by superusers and users with the appropriate SET privilege, but a setting done that way will only persist until the end of the client connection, so this method should be reserved for development purposes. The recommended way to set this parameter is in the postgresql.conf configuration file.","description_zh":"如果需要打开一个可以动态装载的模块并且在 CREATE FUNCTION 或 LOAD 命令中指定的文件名没有目录部分（即名字中不包含斜线），那么系统将搜索这个路径以查找所需的文件。 参数 dynamic_library_path 的值必须是由冒号（Windows 上为分号）分隔的绝对目录路径列表。如果某个列表元素以特殊字符串 $libdir 开头，则会使用编译时确定的 PostgreSQL 软件包的库目录来替换 $libdir；该目录是标准 PostgreSQL 发行版所提供模块的安装位置。（使用 pg_config --pkglibdir 可以找出此目录的名称。）例如： dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' 或者，在 Windows 环境中： dynamic_library_path = 'C:\\tools\\postgresql;H:\\my_project\\lib;$libdir' 这个参数的默认值是'$libdir'。如果该值被设置为一个空字符串，则关闭自动路径搜索。 这个参数可以由超级用户和具有适当 SET 权限的用户在运行时更改，但以这种方式进行的设置只会持续到客户端连接结束，因此这种方法应该保留用于开发目的。推荐设置此参数的方法是在 postgresql.conf 配置文件中。","description_zh_html":"\u003cp\u003e\n        如果需要打开一个可以动态装载的模块并且在 \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e 或 \u003ccode class=\"command\"\u003eLOAD\u003c/code\u003e 命令中指定的文件名没有目录部分（即名字中不包含斜线），那么系统将搜索这个路径以查找所需的文件。\n       \u003c/p\u003e\u003cp\u003e参数 \u003ccode class=\"varname\"\u003edynamic_library_path\u003c/code\u003e 的值必须是由冒号（Windows 上为分号）分隔的绝对目录路径列表。如果某个列表元素以特殊字符串 \u003ccode class=\"literal\"\u003e$libdir\u003c/code\u003e 开头，则会使用编译时确定的 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 软件包的库目录来替换 \u003ccode class=\"literal\"\u003e$libdir\u003c/code\u003e；该目录是标准 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 发行版所提供模块的安装位置。（使用 \u003ccode class=\"literal\"\u003epg_config --pkglibdir\u003c/code\u003e 可以找出此目录的名称。）例如：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\ndynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'\n\u003c/pre\u003e\u003cp\u003e或者，在 Windows 环境中：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\ndynamic_library_path = 'C:\\tools\\postgresql;H:\\my_project\\lib;$libdir'\n\u003c/pre\u003e\u003cp\u003e\n\u003c/p\u003e\u003cp\u003e\n        这个参数的默认值是\u003ccode class=\"literal\"\u003e'$libdir'\u003c/code\u003e。如果该值被设置为一个空字符串，则关闭自动路径搜索。\n       \u003c/p\u003e\u003cp\u003e\n        这个参数可以由超级用户和具有适当 \u003ccode class=\"literal\"\u003eSET\u003c/code\u003e 权限的用户在运行时更改，但以这种方式进行的设置只会持续到客户端连接结束，因此这种方法应该保留用于开发目的。推荐设置此参数的方法是在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 配置文件中。\n       \u003c/p\u003e","doc":{"anchor":"GUC-DYNAMIC-LIBRARY-PATH","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"If a dynamically loadable module needs to be opened and the specified name does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the specified file.","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"dynamic_library_path","short_desc":"Sets the path for dynamically loadable modules.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-client.html","sha256":"1882f8fd5576909c4fcc44af53077378871e05f5be67723f20fe300273024767"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"string","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-DYNAMIC-LIBRARY-PATH","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"dynamic_library_path","SourceDatabase":"center","Version":"18","Locale":"en","Title":"dynamic_library_path","Summary":"If a dynamically loadable module needs to be opened and the file name specified in the CREATE FUNCTION or LOAD command does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the required file. The value for dynamic_library_path must be a list of absolute directory paths separated by colons (or semi-colons on Windows). If a list element starts with the special string $libdir, the compiled-in PostgreSQL package library directory is substituted for $libdir; this is where the modules provided by the standard PostgreSQL distribution are installed. (Use pg_config --pkglibdir to find out the name of this directory.) For example: dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' or, in a Windows environment: dynamic_library_path = 'C:\\tools\\postgresql;H:\\my_project\\lib;$libdir' The default value for this parameter is '$libdir'. If the value is set to an empty string, the automatic path search is turned off. This parameter can be changed at run time by superusers and users with the appropriate SET privilege, but a setting done that way will only persist until the end of the client connection, so this method should be reserved for development purposes. The recommended way to set this parameter is in the postgresql.conf configuration file.","BodyHTML":"\u003cp\u003eIf a dynamically loadable module needs to be opened and the file name specified in the CREATE FUNCTION or LOAD command does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the required file. The value for dynamic_library_path must be a list of absolute directory paths separated by colons (or semi-colons on Windows). If a list element starts with the special string $libdir, the compiled-in PostgreSQL package library directory is substituted for $libdir; this is where the modules provided by the standard PostgreSQL distribution are installed. (Use pg_config --pkglibdir to find out the name of this directory.) For example: dynamic_library_path = \u0026#39;/usr/local/lib/postgresql:/home/my_project/lib:$libdir\u0026#39; or, in a Windows environment: dynamic_library_path = \u0026#39;C:\\tools\\postgresql;H:\\my_project\\lib;$libdir\u0026#39; The default value for this parameter is \u0026#39;$libdir\u0026#39;. If the value is set to an empty string, the automatic path search is turned off. This parameter can be changed at run time by superusers and users with the appropriate SET privilege, but a setting done that way will only persist until the end of the client connection, so this method should be reserved for development purposes. The recommended way to set this parameter is in the postgresql.conf configuration file.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:48d72d55fdd4e2721dac153c7f90b91377429f0830be5c8810fbcd3a354a17c1","ContentHash":"6041f8498305b4ed577378f5ec3145507dba359a6441a51b72effc47d08e19ff","Payload":{"description":"If a dynamically loadable module needs to be opened and the file name specified in the CREATE FUNCTION or LOAD command does not have a directory component (i.e., the name does not contain a slash), the system will search this path for the required file. The value for dynamic_library_path must be a list of absolute directory paths separated by colons (or semi-colons on Windows). If a list element starts with the special string $libdir, the compiled-in PostgreSQL package library directory is substituted for $libdir; this is where the modules provided by the standard PostgreSQL distribution are installed. (Use pg_config --pkglibdir to find out the name of this directory.) For example: dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' or, in a Windows environment: dynamic_library_path = 'C:\\tools\\postgresql;H:\\my_project\\lib;$libdir' The default value for this parameter is '$libdir'. If the value is set to an empty string, the automatic path search is turned off. This parameter can be changed at run time by superusers and users with the appropriate SET privilege, but a setting done that way will only persist until the end of the client connection, so this method should be reserved for development purposes. The recommended way to set this parameter is in the postgresql.conf configuration file."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
